@bevry/testen v3.7.1-next.1603686737.2d6186c245bcc9c3de7bad8b53fe48b4ff13b52a
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.
npm
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
}
}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: