Testing
In software development, there are several different kinds of testing. Each variety of testing serves a different purpose. Unit testing is used to ensure the accuracy of a single unit of computation. Component testing is a method of testing that ensures that the individual units work in concert when combined into a component, for instance, a React Native UI component.
In the React community, the primary tool for application testing is a library called Jest. Jest is an open source testing library, also created by Facebook, that builds on the functionality of a popular testing framework called Jasmine. Jest adds functionality to Jasmine to both make testing of JavaScript applications more robust and to add methods for testing React (and React Native) components.
Using Jest is so common among React Native developers, in fact, that it is now automatically installed and configured when an application is initialized (using react-native
init
). Looking in the package.json
file for our...