Skip to content

Latest commit

 

History

History
56 lines (35 loc) · 1.23 KB

File metadata and controls

56 lines (35 loc) · 1.23 KB

Testing

Outcomes uses Jest and React Testing Library for our test suite. We have __tests__ directories located at any level of the filesystem where tests can be created using the following convention:

logic: src/components/example.js tests: src/components/__tests__/example.test.js

To run the test suite:

yarn test

Development Setup

To set up the development environment with Docker:

docker-compose run --rm ui yarn --ignore-scripts

To run tests in Docker:

docker-compose run --rm ui yarn test

Open ui.outcomes.docker in your browser for the development server.

Linting

Run yarn run lint to lint the src dir, or use Docker:

docker-compose run --rm ui yarn run lint

We are using ESLint.

As a convenience, you can install a pre-push hook for git to prevent pushing eslint failing code to gerrit.

cp hooks/pre-push.example .git/hooks/pre-push

Code Coverage

Code coverage is automatically generated when running the test suite with yarn test.

After running tests, you can inspect the generated HTML report:

open coverage/index.html