-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Thoughts on including react-testing-library in the default template? #6358
Comments
Hey Kent. I think this would fit in nicely with #6270 as a template. What do you think? |
I'm not sure what you mean. Are you suggesting this should be included in the |
Sorry I should have elaborated more. That PR I linked has morphed into a bigger idea of being able to create apps from a template. Templates could be published on npm and referenced using the create-react-app CLI via a specific param. So for react-testing-library it could be something like |
I'd be fine with that. I don't have time to work on it myself (I was just bringing up the idea). It does make sense that the default template would be very bare bones and people could opt-into things like a testing library and other features via flags. 👍 |
Just yesterday, I created a sample app based on create-react-app with react-testing-library just so I could use it "by default" on any new project I create. Jest by itself is not enough for ui tests. Create-react-app, as an opinionated project, could adopt react-testing-library either by default or by a flag. |
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). |
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. |
This sounds reasonable to me. I'd love to get some input from someone on the React team. Dan's on vacation. Maybe @bvaughn? |
I know that @threepointone has expressed this is something he's interested in as well. |
Now 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: kentcdodds/create-react-app-react-testing-library-example@ad467ae
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 😉).
The text was updated successfully, but these errors were encountered: