Testing · Junior · Question 49 of 78

Where do matchers like toBeInTheDocument, toBeVisible and toHaveValue come from?

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.

Further reading

Problem with a question

Testing · Junior · question 49

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