Fill: expect Matcher
填空题 入门
题目
Fill in 空白到 检查 strict equality:
代码
test('strict equality', () => {
expect(5).___(5);
});
提示
matcher for strict equality (===) 是 toBe.
解释
正确答案是 toBe. toBe uses 对象.是 for strict equality comparison. 它's 正确 choice for primitive 值如 数字, 字符串, and 布尔值. For 对象 and 数组, use toEqual 相反.
相关资源
相关课程
- Jest 基础
获取开始使用 Jest.
查阅不认识的术语
新手友好的术语表用大白话解释编程术语——变量、函数、DOM、Promise 等等。
解读错误信息
用大白话解释常见错误——什么意思、为什么发生、如何修复。
动手做项目
通过引导式项目应用所学,含起始代码与解决方案。