@bevry/testen v9.1.0-next.1700863315.1bb1433caf32a4a0a3cdc712e87477dde80ecb73
Run your tests locally against multiple node.js versions
@bevry/testen is a fork of testen which continues maintenance with various improvements and fixes.
Examples
Success
As JSON:
Failure
As JSON:
Usage
Testen uses nvm behind the scenes for its node.js version management.
Node.js Versions
The CLI will determine which Node.js versions to run your tests again in this order of most preferred first:
- use the CLI via
-n <version>flag (--nodeis also suitable):testen -n 8.0.0 -n 10testen -n '8 || 10'testen -n '>=8 <=10'
- use the
package.jsonconfiguration file via:"testen": { "node": ["8.0.0", 10] }"testen": { "node": "8 || 10" }"testen": { "node": ">=8 <=10" }
- use the
package.jsonconfiguration file via:"testen": { "node": "8 || 10" }"testen": { "node": ">=8 <=10" }
- otherwise, the
current,stable, andsystemversions are used which are resolved by nvm
Command
The CLI will default to npm test as the command that will run for each Node.js version, however the API has no such default. You can customize this via:
- use the CLI via
-- <command>, e.g.testen -- echo hello world - use the
package.jsonconfiguration file via"testen": { "serial": true }
Serial or Parallel
By default tests will run in parallel (multiple at once), to use serial, you can either:
- use the CLI via
-sflag (--serialis also suitable) - use the
package.jsonconfiguration file via"testen": { "serial": true }
JSON Output
By default Testen will output pretty output, to only output the JSON result, you can either:
- use the CLI via
-jflag (--jsonis also suitable) - use the
package.jsonconfiguration file via"testen": { "json": true }
Other CLI Flags
Refer to testen --help.
API Usage
Testen also provides an API which can be used like so:
const { Versions } = require('@bevry/testen')
async function main() {
const versions = new Versions([4, 8, 10, 'current', 'stable', 'system'])
await versions.load()
await versions.install()
await versions.test('npm test')
console.log(versions.success)
}
main()Complete API documentation is available.
npm
Discover the release history by heading on over to the HISTORY.md file.
Discover how you can contribute by heading on over to the CONTRIBUTING.md file.
These amazing people are maintaining this project:
No sponsors yet! Will you be the first?
These amazing people have contributed code to this project:
Discover how you can contribute by heading on over to the CONTRIBUTING.md file.
Unless stated otherwise all works are:
and licensed under: