Want to check if your code is formatted consistently + pick up on any syntax errors:
./node_modules/.bin/eslint "src/**/*.js"
This project is set up to use jest for tests. You can configure whatever testing strategy you like, but jest works out of the box. Create test files in directories called __tests__ or with the .test extension to have the files loaded by jest. See the the template project for an example test. The jest documentation is also a wonderful resource, as is the React Native testing tutorial.
Runs the jest test runner on your tests.
Run npm test to run a test add -- --watch to run it in developer mode.
To run an individual Jest test:
- Run
jest path/to/test.jsif you have Jest installed globally - Run
node_modules/.bin/jest path/to/test.jsto use the projects Jest installation
Tests should be placed in their related parents folder to keep consistency, i.e components/__tests__ or containers/__tests__
- (Snapshot testing) https://facebook.github.io/jest/docs/tutorial-react-native.html#snapshot-test
- (DOM testing WIP) https://facebook.github.io/jest/docs/tutorial-react.html#dom-testing