1.0.5 • Published 6 months ago
@dotcom-tool-kit/node-test v1.0.5
dotcom-tool-kit/node-test
Run tests via the Node.js built-in test runner.
Installation & Usage
With Tool Kit already set up, install this plugin as a dev dependency:
npm install --save-dev @dotcom-tool-kit/node-testAnd add it to your repo's .toolkitrc.yml:
plugins:
- '@dotcom-tool-kit/node-test'Tasks
NodeTest
Run tests via the Node.js built-in test runner
Task options
| Property | Description | Type | Default |
|---|---|---|---|
concurrency | The number of test processes to run in parallel. See https://nodejs.org/docs/latest-v20.x/api/test.html#runoptions | number (int, >0) or boolean | false |
files | Glob patterns used to find test files to run | Array<string> | ["**/*.test.?(c\|m)js","**/*-test.?(c\|m)js","**/*_test.?(c\|m)js","**/test-*.?(c\|m)js","**/test.?(c\|m)js","**/test/**/*.?(c\|m)js"] |
forceExit | Whether to force exit the test process if something is holding it open | boolean | false |
ignore | Glob patterns for files to ignore when running tests | Array<string> | ["**/node_modules/**"] |
watch | Whether to run tests in "watch" mode, automatically rerunning them when related files change | boolean | false |
customOptions | Additional options to pass to the test runner, for those that Tool Kit does not explicitly support. See https://nodejs.org/docs/latest-v20.x/api/test.html#runoptions | Object with dynamic keys of type string and values of type unknown (optional & nullable) |
All properties are optional.