You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I followed the exact instructions as in your readme, and using the latest version of the library,
Created a setupTests.ts file, with the single line import "@testing-library/jest-dom"
Made sure this file is referenced in the tsconfig.json, inside of the includes. "include": ["./setupTests.ts"],
Also referenced it in the jest.config.js setupFilesAfterEnv: ["./setupTests.ts"]
Now when i run tests, they all pass,
but in the test file, I get a typescript error, that the type toBeVisible does not exist, but if I added a direct import of @testing-library/jest-dom then typescript was happy.
THEN
I uninstalled the latest version of @testing-library/jest-dom and went to Version 5.16.5, from one year back and installed that. I made no other change and found that immediately the toBeVisible type was no longer throwing an error.
It seems therefore that sometime after Version 5.16.5, a bug has been introduced - OR that you need to update the usage as the old usage instructions are no longer valid.
Version 5.17.0 is fine too, it seems the issue is from Version 6 onwards, possibly the usage instructions need changing, or there is a breaking error.
The text was updated successfully, but these errors were encountered:
I followed the exact instructions as in your readme, and using the latest version of the library,
Created a setupTests.ts file, with the single line
import "@testing-library/jest-dom"
Made sure this file is referenced in the tsconfig.json, inside of the includes.
"include": ["./setupTests.ts"],
Also referenced it in the jest.config.js
setupFilesAfterEnv: ["./setupTests.ts"]
Now when i run tests, they all pass,
but in the test file, I get a typescript error, that the type
toBeVisible
does not exist, but if I added a direct import of@testing-library/jest-dom
then typescript was happy.THEN
I uninstalled the latest version of
@testing-library/jest-dom
and went to Version 5.16.5, from one year back and installed that. I made no other change and found that immediately thetoBeVisible
type was no longer throwing an error.It seems therefore that sometime after Version 5.16.5, a bug has been introduced - OR that you need to update the usage as the old usage instructions are no longer valid.
Version 5.17.0 is fine too, it seems the issue is from Version 6 onwards, possibly the usage instructions need changing, or there is a breaking error.
The text was updated successfully, but these errors were encountered: