Skip to content

Regression: jest-dom removed from dependencies #146

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

Closed
nickserv opened this issue Jul 25, 2018 · 1 comment
Closed

Regression: jest-dom removed from dependencies #146

nickserv opened this issue Jul 25, 2018 · 1 comment

Comments

@nickserv
Copy link
Member

nickserv commented Jul 25, 2018

  • react-testing-library version: 4.1.3

Relevant code or config:

import 'jest-dom/extend-expect'

Problem description:

4.1.3 updates dom-testing-library to 3, which removes its dependency on jest-dom and a re-export. This is a breaking change in react-testing-library, which still documents a jest-dom import, causing my tests to fail after updating the package.

Suggested solution:

Revert 4.1.3 or deprecate it and release a major release of this library to signify a breaking change and document that jest-dom should be installed manually.

Workaround:

Install jest-dom.

@kentcdodds
Copy link
Member

Sorry this broke for you @nickmccurdy. I believe that explicit support for the implicit jest-dom dependency was removed in react-testing-library 3.0.0 and that's when you were supposed to add jest-dom to your dependencies yourself. The fact that dom-testing-library continued to include jest-dom was a mistake. I didn't consider this a breaking change in react-testing-library because we'd already changed the documentation to indicate you should install jest-dom manually.

I understand where you're coming from, but at this point I don't think many more people will bump into this problem, and considering the major release for this breaking change was technically already released I don't see any value in doing another major release.

Sorry for the confusion.

julienw pushed a commit to julienw/react-testing-library that referenced this issue Dec 20, 2018
- show the much-asked-for data-test-id override as the default example
- use commonjs module syntax due to a babel 6 issue with overwriting named exports (not present in v7)

<!--
Thanks for your interest in the project. Bugs filed and PRs submitted are appreciated!

Please make sure that you are familiar with and follow the Code of Conduct for
this project (found in the CODE_OF_CONDUCT.md file).

Also, please make sure you're familiar with and follow the instructions in the
contributing guidelines (found in the CONTRIBUTING.md file).

If you're new to contributing to open source projects, you might find this free
video course helpful: http://kcd.im/pull-request

Please fill out the information below to expedite the review and (hopefully)
merge of your pull request!
-->

<!-- What changes are being made? (What feature/bug is being fixed here?) -->

**What**:

<!-- Why are these changes necessary? -->

**Why**:

<!-- How were these changes implemented? -->

**How**:

<!-- Have you done all of these things?  -->

**Checklist**:

<!-- add "N/A" to the end of each line that's irrelevant to your changes -->

<!-- to check an item, place an "x" in the box like so: "- [x] Documentation" -->

- [ ] Documentation
- [ ] Tests
- [x] Ready to be merged <!-- In your opinion, is this ready to be merged as soon as it's reviewed? -->
- [ ] Added myself to contributors table <!-- this is optional, see the contributing guidelines for instructions -->

<!-- feel free to add additional comments -->
lucbpz pushed a commit to lucbpz/react-testing-library that referenced this issue Jul 26, 2020
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