If you know me, you know I have opinions about testing software. I’ve been writing software for over ten years now. The single most important skill that I have picked up is writing automated tests. It helps make our work more predictable and increases confidence to make changes. Heck, it’s even fun! If you haven’t used tests to drive a feature, check out my workshop from RailsConf.
Existing tools for testing React Native apps are deeply coupled to a component's rendered structure. By using the object traversal generator function from the last post, you can write tests that focus on content and stand up to changes that don't affect behavior.
In my recent experience, getting started with React Native testing is a little rough since tpopular tools aren't great for integrated testing. The first step is traversing the object tree of a rendered component. For that, generator functions are of great use!