Framework wrappers and DOM testing library
Describe the bug Docs seem confusing or conflicting itself
To Reproduce Steps to reproduce the behavior:
Go to this page: https://testing-library.com/docs/user-event/install/
It says:
If you use one of the framework wrappers, it is important that @testing-library/dom is resolved to the same installation required by the framework wrapper of your choice. Usually this means that if you use one of the framework wrappers, you should not add @testing-library/dom to your project dependencies.
But going to one of the framework wrappers: https://testing-library.com/docs/react-testing-library/intro
It says:
To get started with React Testing Library, you'll need to install it together with its peerDependency @testing-library/dom:
So, should we include @testing-library/dom or not?
Desktop (please complete the following information):
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
Smartphone (please complete the following information):
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
Additional context Add any other context about the problem here.
Hi @jacklaurencegaray, thanks for opening this one. Actually, in React Testing Library we've made this change since version 16 to not include DTL and I assume this comment in our docs is prior to that change. We're happy to accept PRs to the docs to fix this :)
Just to clarify, this means that installing DTL moving forward is not necessary anymore right? And the change in docs I have to do is to remove the part that states you need to install it in the RTL docs?
No that's actually the opposite :) In RTL we're not installing DTL as a dependency anymore and it has moved to be a peerDependency. That means that a user trying to install RTL will need to install DTL too so the docs in RTL are correct.