Open AlexVild opened 2 years ago
I am facing the same issue. Have you found any solution of this?
I am facing the same issue. Have you found any solution of this?
Nope :(
I am facing the same issue. Have you found any solution of this?
I ran into this issue as well and I had to change my setup-jest.ts file to have the testing-library/jest-dom import at the top 🤷
import '@testing-library/jest-dom';
import './jest-global-mocks';
@testing-library/jest-dom
version: 5.2.0node
version: 16.17.0npm
(oryarn
) version: 8.15.0Relevant code or config:
In my project's root you can find two files:
setup-jest.ts
and
jest-config.ts
:As instructed by jest-dom's installation instructions.
What you did:
I've been scaffolding my angular (v13) project's testing, and decided jest-dom would be perfect after migrating my testing framework to Jest.
I installed jest-dom via
npm i --save-dev @testing-library/jest-dom
, then added the import to mysetup-jest.ts
file, which is loaded in during jest startup as configured injest.config.js
.What happened:
Upon running jest for any test, I get the following error thrown from
setup-jest.ts
:Reproduction:
Problem description:
I can't use jest-dom at all, as it seems like there's a dependency issue?
Suggested solution: