-
Notifications
You must be signed in to change notification settings - Fork 24
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
Make @testing-library/dom a peer dependency #70
Comments
I got a problem similar to yours @gndelia. I upgraded to
I had to use explicitly the jsdom environement in my test files (@jest-environment jsdom). Then the test using
In
This configuration prevents to have the I don't know how peer dependency works, so I can't answer to the proposed solution by @gndelia. |
Hi both! Thank you for reporting this! Would either of you be open to submitting a PR to fix this? Thanks again! 😊 |
Hi! I've changed my work's project since opening this ticket, so I'm not currently using it 😅 (not event RTL), so I don't think I can properly test it. If I get the chance to work again with the libraries, and the issue is open, I'll do the PR |
Hi. First of all, thanks for this library, it works great for testing with
react-select
, which help us avoiding those uglyquerySelector
calls 😅I'm using
@testing-library/react
which ships with its own version of@testing-library/dom
, which may be different from the one used by this package. The issue we faced is that, suddenly, after installing this library, many tests started to fail, even though none of these were using this library. We think this discrepancy is due to the fact that this library adds another version of@testing-library/dom
If I understand correctly, as this works as a "plugin" of
@testing-library/react
it shouldn't be necessary to ship@testing-library/dom
as a dependency, but as a peer dependency, as the consumers of this library will provide the proper version. Peer dependencies also allow to specify the minimum version required to work (in this case,>= 7
).Does that makes sense?
The text was updated successfully, but these errors were encountered: