Skip to content
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

Property 'toBeInTheDocument' does not exist on type 'Assertion'.ts(2339) #541

Open
elite0107 opened this issue Oct 26, 2023 · 1 comment

Comments

@elite0107
Copy link

I followed the introduction how to use jest with typescript.
I created jest.setup.ts file and imported @testing-library/jest-dom.
But getting unexpected error and couldn't find a way to solve this issue.

Property 'toBeInTheDocument' does not exist on type 'Assertion'.ts(2339)

my package.json file is as follows.

{
   ...
   "@testing-library/jest-dom": "^6.1.4",
   "@testing-library/react": "^14.0.0",
   "@testing-library/user-event": "^14.5.1",
   "@types/jest": "^29.5.6",
   "@types/testing-library__jest-dom": "^6.0.0",
   ...
}
@Chaedie
Copy link

Chaedie commented Sep 4, 2024

@elite0107
Hello, I think this issue is little bit stale.

I just looked around my package.json and I realized "@types/testing-library__jest-dom" is not in there. And npm (Link) said This package has been deprecated.

So, I recommend you to remove @types/testing-library__jest-dom and reinstall with
npm install --save-dev @testing-library/react @testing-library/dom @types/react @types/react-dom

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants