While working on a project that utilized create-react-app
, I came across a file called setupTest.js
. This file simply imports @testing-library/jest-dom
and extends the expect
version in tests with methods like .toBeInTheDocument
.
I decided to add the same file, setupTest.js
, to my own project but unfortunately it did not have any effect.
In simpler terms, I am curious about how to import @testing-library/jest-dom
globally instead of having to do it in each .spec.ts
file.