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

It looks like the Recent Build has a Breaking Error in it OR that you need to update the usage #535

Open
mickeypuri opened this issue Sep 15, 2023 · 0 comments

Comments

@mickeypuri
Copy link

mickeypuri commented Sep 15, 2023

I followed the exact instructions as in your readme, and using the latest version of the library,

  1. Created a setupTests.ts file, with the single line
    import "@testing-library/jest-dom"

  2. Made sure this file is referenced in the tsconfig.json, inside of the includes.
    "include": ["./setupTests.ts"],

  3. 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.

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

1 participant