Skip to content

Latest commit

 

History

History
30 lines (18 loc) · 1.56 KB

File metadata and controls

30 lines (18 loc) · 1.56 KB

Testing

Linting (with eslint)

Want to check if your code is formatted consistently + pick up on any syntax errors:

./node_modules/.bin/eslint "src/**/*.js"

Writing and Running Tests

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 within the directory (from root) called /__tests__/ to have them 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.

yarn test

Runs the jest test runner on your tests.

Jest Snapshots

Run yarn test to run a test add -- --watch to run it in developer mode.

To run an individual Jest test:

  • Run jest path/to/test.js if you have Jest installed globally
  • Run node_modules/.bin/jest path/to/test.js to use the projects Jest installation

Tests should be placed in the root __tests__ directory, followed by their related parents folder to keep consistency, i.e /__tests__/containers/ExampleForm.js