3.7.0-next.1589195913.1190ea6f936b7ecd73226b57f81e6c87cfa3cca7 • Published 6 years ago

@bevry/testen v3.7.0-next.1589195913.1190ea6f936b7ecd73226b57f81e6c87cfa3cca7

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

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

Complete API Documentation.

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.node property of your projects package.json file
  • otherwise, the travis or circle ci node versions that you have configured for your project
  • otherwise, the current, stable, and system versions 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.command property of your projects package.json file
  • otherwise, npm test is used

Other key arguments are:

  • --json will output the results in JSON format, for progamatic consumption
  • --verbose will report the details of all versions, not just the versions that have failed
  • --serial will 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: