Testing · Junior · Question 49 of 78
Where do matchers like toBeInTheDocument, toBeVisible and toHaveValue come from?
- ✓Correct answer: From
@testing-library/jest-dom, connected in the test setup file - 2They are built into Jest
- 3They are part of React
Explanation
Import @testing-library/jest-dom (or @testing-library/jest-dom/vitest) in a setup file. They give clearer error messages than manual DOM checks.