Testing · Junior · Question 21 of 78

Which matcher checks that an array contains an element?

Explanation

toContain uses ===; to find an object by contents use toContainEqual. toMatch is for strings and regexes, toHaveProperty for object keys.

Further reading

Problem with a question

Testing · Junior · question 21

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