nodejs-test
Options for package.json script configured tests.
Your preferred test runner is configured via the package.json#scripts.test
field.
The only expectation from pants is that the test
script can accept a variadic number of path arguments, relative to the package.json, and that any configuration files are file
dependencies to the package_json
.
Simple example:
Consider a directory-layout:
├── BUILD
├── src/
│ ├── BUILD
│ ├── test/
│ │ ├── BUILD
│ │ └── index.test.js
│ └── index.js
└── package.json
where package.json contains
package.json
{
...
"scripts": {
"test": "mocha"
},
"devDependencies: {
...
}
}
Executing pants test src/test/index.test.js
will cause the equivalent of mocha src/test/index.test.js
to run.
Backend: pants.backend.experimental.javascript
Config section: [nodejs-test]