mocha-env-reporter

4.0.0 • Public • Published

mocha-env-reporter

Build Status npm version

A mocha reporter that switches output format between built-in 'spec' and customised CI reporters base on where tests are being executed - locally or ci. Actual switch is implemented by detecting an environment variable unique to each CI environment. The default is 'spec' builtin mocha reporter.

The reporter also supports an environment variable mocha_reporter in which you can set an arbitrary environment reporter. This is useful if you use an unidentified continous integration service.

Currently supported custom CI environments (see defaults.json):

  • Teamcity
  • bamboo
  • jenkins

install

npm install --save-dev mocha-env-reporter

usage

In you package.json append --reporter mocha-env-reporter to your mocha test command, ex.

...
  "scripts": {
    "test": "mocha --reporter mocha-env-reporter"
  },
...

configuration

In order to override the choice of reporter simply set environment variable mocha_reporter to the reporter name (example specs).

The default reporters per environments are defined at defaults.json

License

Licensed under MIT License.

Readme

Keywords

Package Sidebar

Install

npm i mocha-env-reporter

Weekly Downloads

1,815

Version

4.0.0

License

MIT

Unpacked Size

5.89 kB

Total Files

11

Last publish

Collaborators

  • amir-arad