question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Thoughts on including react-testing-library in the default template?

See original GitHub issue

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: 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:closed
  • Created 5 years ago
  • Reactions:17
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
kentcdoddscommented, Sep 30, 2019

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.

1reaction
corlaezcommented, Mar 3, 2019

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).

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Testing Library
The React Testing Library is a very light-weight solution for testing React components. It provides light utility functions on top of react-dom ...
Read more >
Testing Recipes - React
Mocking data fetching with “fake” data prevents flaky tests due to an unavailable backend, and makes them run faster. Note: you may still...
Read more >
How to Start Testing Your React Apps Using the React Testing ...
The React Testing Library is a great package for testing React Apps. It gives us access to jest-dom matchers we can use to...
Read more >
React Testing Library Crash Course - YouTube
... course that will teach you the ins and outs of React Testing Library. ... 33K views 11 months ago ... Udemy Course...
Read more >
Moving to React Testing Library
When compared to Enzyme's shallow , RTL makes testing function components with hooks easier. It may be nearly impossible to get coverage on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found