-
Notifications
You must be signed in to change notification settings - Fork 404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jest-dom 6.1.4 breaks jest types #544
jest-dom 6.1.4 breaks jest types #544
Comments
I've come across the issue you're experiencing and I believe I have a solution that might help you. If you add the following line to your
This will inform TypeScript to include the type definitions from @testing-library/jest-dom, which should resolve the type errors you're seeing. |
i already tried that and mentioned in the issue itself. it didn't worked |
I've just upgraded a CRA application with React 18 (with JS not TS) from:
to
and I'm getting the same issue: Global jest types are not working with intellisense. I've noticed that my Which I believe is causing the issue. So far, I've found 2 solutions: Solution 1Add:
to you Solution 2Install
The latter might work best for you :) @pavanjoshi914 Nonetheless, I'll wait for a fix regarding this issue. |
if i add @types/jest and use |
the solution worked for me is, use @types/jest instead of @jest/types. and introduce typings that i use in tests explicitly in tsconfig but still it will be good to make newer versions compatible with @jest/types package as well |
Oh wow, I had no idea
So it seems adding |
Hey there, |
@testing-library/jest-dom
6.1.4:node
>=16:jest
(orvitest
) version:0.2.29npm
(oryarn
) version: >=1.0.0Relevant code or config:
What you did:
What happened:
it breaks the jest types when running tsc compile command
Reproduction:
even if i define types in my tsconfig error still persist
The text was updated successfully, but these errors were encountered: