Thoughts on including react-testing-library in the default template?
See original GitHub issueNow that React is officially recommending people use react-testing-library, I wonder whether people would be in favor of including it by default. I made a video about what you need to do to add react-testing-library to create-react-app:
https://www.youtube.com/watch?v=Yx-p3irizCQ&list=PLV5CVI1eNcJgCrPH_e6d57KRUTiDZgs0u&t=60s
This commit is me adding the library and setup: https://github.com/kentcdodds/create-react-app-react-testing-library-example/commit/ad467aebee35f2ce040402658d3365c7c1f6335c
Note: In that commit and video I demo how to include
jest-dom
which I think would be good to include as well, but I have no problem if ya’ll would prefer not to include that.
I’d love to see a 👍 if you’re in favor and a 👎 if you’re not. I promise to not tweet about this issue myself to avoid bringing unfair attention in my favor (though others can feel free to if they want 😉).
Issue Analytics
- State:
- Created 5 years ago
- Reactions:17
- Comments:9 (7 by maintainers)
Top GitHub Comments
I’d like to bring this up again. It’s been several months and we’ve seen a steady growth in the popularity of React Testing Library in that time, especially among newcomers who are desperately wanting to know how to test their apps. I say let’s make this the default.
The adding as template idea is good, but as @gustavobini says jest is really not enough for react testing and it would make sense to add as a default (because otherwise people will just use enzyme as there is years of articles and docs about it).