The aim of this project is to provide an opinionated guide on how to write effective & clean unit tests for React Native applications. There are plenty of articles & guides out there on this topic, but most of them are not talking about the frequent issues React Native developers come across when testing their applications.
Some of the topics covered in this guide are:
- The philosophy behind unit testing:
- Why unit tests exist
- Understanding what to unit test and what NOT to unit test
- Testing components
- Testing hooks
- Testing
- Shallow Testing
- What is Shallow Testing
- When to shallow test versus when NOT to shallow test
- A deep dive on mocking native modules
- Understanding Jest's config file
- Why snapshot tests are bad and how to replace them
- TBTB: The Badass Test Boilerplate
I want to maintain this repository as a side project and hopefully help future React Native developers on writing excellent unit tests for their applications. If you have any suggestions on topics you'd like to see covered, feel free to create a new discussion!