Skip to content

Dependency on @testing-library/dom #294

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
eps1lon opened this issue Mar 21, 2023 · 4 comments · Fixed by #304
Closed

Dependency on @testing-library/dom #294

eps1lon opened this issue Mar 21, 2023 · 4 comments · Fixed by #304
Labels

Comments

@eps1lon
Copy link
Member

eps1lon commented Mar 21, 2023

It's not apparent from the documentation why this plugin has a dependency on @testing-library/dom.

It looks like it does some branching based on whether a query is a DTL query or not but I can't find documentation how this affects rules in this repo.

This would help asses if we need a direct runtime dependency (current) or peer dependency or configuration option instead i.e. instead of requiring DTL and getting the list of queries, the user inputs that list.

Documenting this internal behavior would help to understand if custom queries should also be considered.

Ideally there wouldn't be a dependency on /dom at all so that users just have to update /dom if that releases a major and not update /dom and eslint-plugin-jest-dom. jest-dom doesn't have a dependency on /dom after all.

@ctjhoa
Copy link

ctjhoa commented Apr 3, 2023

Completely agree on that, I struggled to find why I had many React act warning (testing-library/react-testing-library#1051) to finally see that there was a mismatch between @testing-library/dom required by eslint-plugin-jest-dom and @testing-library/react

@cbookg
Copy link

cbookg commented Apr 3, 2023

I had to remove this plugin in order to upgrade to React 18. It would be nice to be able to add it back.

@ctjhoa
Copy link

ctjhoa commented Apr 3, 2023

@cbookg You can use yarn resolutions or npm overrides to continue to use this plugin but not really a long term solution.
eg.

  "resolutions": {
    "@testing-library/dom": "^9.0.0",
  },

@github-actions
Copy link

github-actions bot commented Jun 4, 2023

🎉 This issue has been resolved in version 5.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

3 participants