Skip to content

Latest commit

 

History

History
75 lines (46 loc) · 2.57 KB

File metadata and controls

75 lines (46 loc) · 2.57 KB

Running Tests

Tests are an important part of coding. Please refer to the following instructions when contributing to the repository.

Ensure you're on Node v10 If you need help updating, please see NVM. ❤️ NVM.

Screenshot Tests

Please refer to screenshot tests.

Unit Tests

We use:

To run a single instance of the tests, run:

npm run test:unit

To run the tests with a debugger in Chrome:

npm run test:watch

Click on the big DEBUG button in the top righthand corner. In the new tab that Chrome opens, you can open the developer tools and debug per usual.

karma-debug-button

Test Coverage

We use Istanbul to report and check code coverage. To build the coverage report, please run the unit tests npm run test:unit. This will create a coverage/ directory in the root of the project. Open ./coverage/Chrome <version_number>/index.html. This will show a screen like:

screen shot 2018-11-14 at 10 31 07

We aim for:

  • Statements: 95%
  • Branches: 95%
  • Functions: 95%
  • Lines: 95%

If they do not meet these requirements, we will ask to increase test coverage.

Running Lint

Below is a list of the Eslint standards:

To run lint:

npm run lint

This will print any lines that do not follow the eslint standards, which you will need to fix before opeing a PR.

Type Tests

Due to multiple issues in production type files an easy way to validate production type files has been added:

npm run test:types

This command will perform a full production build, install the locally built versions, generate a file that imports them all, and then build it to expose any issues in the locally built .d.ts files.