Testing · Junior · Question 17 of 78

How does toStrictEqual differ from toEqual?

Explanation

expect({ a: undefined, b: 2 }).toEqual({ b: 2 }) passes, but toStrictEqual fails.

Further reading

Problem with a question

Testing · Junior · question 17

Test yourself

Take the Testing · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz