@bevry/testen
Run your tests locally against multiple node.js versions
Last updated a month ago by bevryme .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @bevry/testen 
SYNC missed versions from official npm registry.

@bevry/testen

Travis CI Build Status NPM version NPM downloads Dependency Status Dev Dependency Status
GitHub Sponsors donate button Patreon donate button Flattr donate button Liberapay donate button Buy Me A Coffee donate button Open Collective donate button crypto donate button PayPal donate button Wishlist browse button

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

success case

As JSON:

success case as JSON

Failure

failure case

As JSON:

failure case 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.

Install

npm

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/testen aliases @bevry/testen/source/index.js
  • @bevry/testen/source/index.js is 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?

GitHub Sponsors donate button Patreon donate button Flattr donate button Liberapay donate button Buy Me A Coffee donate button Open Collective donate button crypto donate button PayPal donate button Wishlist browse button

Contributors

These amazing people have contributed code to this project:

Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

License

Unless stated otherwise all works are:

and licensed under:

Current Tags

10 Versions

Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 11
Last Month 37
Dependencies (11)
Dev Dependencies (13)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |