@dotcom-tool-kit/jest
v4.0.2
Published
A plugin to run [Jest](https://jestjs.io/) tests. This plugin uses [jest-cli](https://www.npmjs.com/package/jest-cli) to run the tests. You can configure this plugin by specifying the path to the Jest config path.
Downloads
2,649
Readme
@dotcom-tool-kit/jest
A plugin to run Jest tests. This plugin uses jest-cli to run the tests. You can configure this plugin by specifying the path to the Jest config path.
Installation
With Tool Kit already set up, install this plugin as a dev dependency:
npm install --save-dev @dotcom-tool-kit/jest
And add it to your repo's .toolkitrc.yml
:
plugins:
- '@dotcom-tool-kit/jest'
Tasks
Jest
Runs jest
to execute tests.
Task options
| Property | Description | Type |
| :----------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------- |
| configPath
| Path to the Jest config file. Use Jest's own config resolution by default. | string
|
| ci
| Whether to run Jest in CI mode. | true
|
All properties are optional.
Tips
A common use case is to configure test:local
and test:ci
in your .toolkitrc.yml
to run the Eslint
task then the relevant Jest task:
commands:
test:local:
- Eslint
- Jest
test:ci:
- Eslint
- Jest:
ci: true