Testing your app with Jest
Learn how to test your React/Redux app thoroughly, including actions, reducers and components!
We'll cover the following...
Testing apps is something that a lot of developers should be doing, but a lot of them don’t. It has a bunch of really nice benefits:
- You catch bugs before they happen. The obvious out of the bunch, but nontheless very important. We all make mistakes, and with an automated test suite (an array of tests) we make sure no users has to ever see those!
- Tests are executable documentation. This is in my opinion the biggest benefit. With a function that is well tested you can immediately figure out what it’s used for, how you should use it and what to expect it to do! No more tedious documentation writing.
- Tests save time. This might be a bit counterintuitive, since writing tests takes away time you’d spend writing your app. But then you still have to do Q&A, manual testing to make sure you didn’t break something else with a change! Automated tests save so much time that would be spent manually doing Q&A and finding bugs!
- You will write better code. Some code is harder to test, some easier. You’ll start writing easier testable code, which automatically is better code!
With this in mind, there’s no way we could not test our application! Let’s get ...