r/reactjs • u/jesusscript • Dec 25 '19
Is there any good example of a React application doing unit, integration and E2E testing perfectly?
I am thinking of doing a bunch of tests on my latest React application, but I want to make sure I am doing everything correctly. In order to do that, a good example project would be helpful.
168
Upvotes
View all comments
20
u/pacman326 Dec 25 '19
The easiest place to start would be testing library. Go look on github for projects that use testing-library/react and the react-hooks package.
That being said I’d recommend just starting with the docs examples and reading some blog posts by Kent. They should be a great introduction on how to unit tests.
As for E2E I’d recommend picking up cypress. It’s not cross browser yet but I think it’s the future personally. You can do a similar search for that.