Socket
Socket
Sign inDemoInstall

mocha-env-reporter

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mocha-env-reporter

ci/dev environment aware mocha reporter


Version published
Weekly downloads
715
decreased by-38.94%
Maintainers
1
Weekly downloads
 
Created
Source

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.

Keywords

FAQs

Package last updated on 21 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc