Unit Test In React Native Using Jest
suggest changeStarting with React Native 0.38, react-native init adds a Jest setup. This configuration should already be in your package.json:
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"jest": {
"preset": "react-native"
}
Run npm test or jest. For a full sample, see the Jest React Native example.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents