Testing React Native Apps
At Facebook, we use Jest to test React Native applications.
Get a deeper insight into testing a working React Native app example by reading the following series:
- Part 1: Jest – Snapshot come into play
- Part 2: Jest – Redux Snapshots for your Actions and Reducers.
Setup
Starting from react-native version 0.38, a Jest setup is included by default when running npx @react-native-community/cli init. The following configuration should be automatically added to your React Native's jest.config.js file:
module.exports = {
preset: 'react-native',
};
Run