What testing framework and libraries do you like to use? Do you just unit test or write e2e tests or both? Anything you've learned along the way?
I highly suggest using Enzyme to test React components: https://github.com/airbnb/enzyme
And if you like chai, use this along with it: https://github.com/producthunt/chai-enzyme
Juho Vepsäläinen
SurviveJS
I used Jest when starting out. It was quite slow though so I moved to Karma/Mocha based solution. Apparently the performance of Jest has improved so it might be a better choice now.
You can see Karma and Mocha in action at Reactabular, a table library of mine. It's just unit tests for now, but I'm aware I should write more higher level tests to support those. It would be also nice to hook up Saucelabs or a similar solution to test the component against different browsers. That should be fairly easy to pull off on top of the current setup.
My setup generates also coverage information. I push that to codecov.io to figure out which parts I should test better. A good coverage has definitely helped a lot in this project and I'm fearless when refactoring.
Besides testing I run ESLint using modified AirBnB preset. Some of the rules got in my way so I ended up disabling or modifying them a bit. I run the tests and lint automatically using a prepush hook. This allows me to rebase (
git rebase -i) and fix my commits before getting those in public.The Karma/Mocha setup can be a little difficult to get running well but I would say it's well worth the time investment. Jest could be a good starting point, though, as the setup is so easy.