How it works...

Running the tests is achieved with a single command, as before:

npm test

The output is as shown in the following screenshot—note that we also ran some tests we had copied from the React chapter, without any changes, and they also performed perfectly:

All our components' tests run OK

So, apart from the need to use shallow rendering, and possibly some changes in the way we access elements or simulate events, coding unit tests for RN is pretty much the same as for React, which is good news. We are forgetting something, however – what about snapshot testing? Let's move on to that.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.174.156