README
@bevry/testen
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 runs your tests again multiple node versions, however the testen client can only run on Node 8 or higher.
Testen uses nvm behind the scenes for its node.js version management.
CLI Usage
You can specify the exact node versions to test your project against by using the -n <version> flag (--node is also suitable).
This flag can occur multiple times, and also supports versions seperated by a comma.
Such that testen -n 8 -n 10 and testen -n 8,10 will both use node versions 8 and 10.
If you do not specify any node versions via the CLI arguments, then it will use:
- the
testen.nodeproperty of your projectspackage.jsonfile - otherwise, the travis or circle ci node versions that you have configured for your project
- otherwise, the
current,stable, andsystemversions which are resolved by nvm
If a node version is currently missing, it will be installed for you automatically.
You can specify the exact command to run against your project by placing it after the -- argument, for example testen -- echo hello world to run echo hello world.
If you do not specify a command via the CLI, then it will use:
- the
testen.commandproperty of your projectspackage.jsonfile - otherwise,
npm testis used
Other key arguments are:
--jsonwill output the results in JSON format, for progamatic consumption--verbosewill report the details of all versions, not just the versions that have failed--serialwill run the tests serially (one after the other), however for performance, loading of versions still occurs in parallel
And full help, as always is available via 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()
console.log(versions.success)
}
main()
Complete API documentation is available.
Install
Install Globally
- Install:
npm install --global @bevry/testen - Executable:
@bevry/testen
Install Locally
- Install:
npm install --save @bevry/testen - Executable:
npx @bevry/testen - Import:
import * as pkg from ('@bevry/testen') - Require:
const pkg = require('@bevry/testen')
Editions
This package is published with the following editions:
@bevry/testenaliases@bevry/testen/source/index.js@bevry/testen/source/index.jsis ESNext source code for Node.js with Require for modules
TypeScript
This project provides its type information via inline JSDoc Comments. To make use of this in TypeScript, set your maxNodeModuleJsDepth compiler option to 5 or thereabouts. You can accomlish this via your tsconfig.json file like so:
{
"compilerOptions": {
"maxNodeModuleJsDepth": 5
}
}
History
Discover the release history by heading on over to the HISTORY.md file.
Contribute
Discover how you can contribute by heading on over to the CONTRIBUTING.md file.
Backers
Maintainers
These amazing people are maintaining this project:
Sponsors
No sponsors yet! Will you be the first?
Contributors
These amazing people have contributed code to this project:
- Benjamin Lupton — view contributions
- Greenkeeper — view contributions
- Kevin Titor — view contributions
Discover how you can contribute by heading on over to the CONTRIBUTING.md file.
License
Unless stated otherwise all works are:
- Copyright © 2016-2017 Kevin Titor
- Copyright © 2018+ Benjamin Lupton
and licensed under:



