Testing · Junior · Question 17 of 78
How does toStrictEqual differ from toEqual?
- ✓Correct answer: It also checks
undefinedproperties, sparse arrays and object types (class instances vs plain objects) - 2It compares by reference
- 3It ignores the order of array elements
Explanation
expect({ a: undefined, b: 2 }).toEqual({ b: 2 }) passes, but toStrictEqual fails.