Testing · Junior · Question 21 of 78
Which matcher checks that an array contains an element?
- ✓Correct answer:
toContain - 2
toHaveProperty - 3
toMatch
Explanation
toContain uses ===; to find an object by contents use toContainEqual. toMatch is for strings and regexes, toHaveProperty for object keys.