skylinezum / mocha-circleci-reporter

A mocha reporter that supports Circle CI, via a combined jUnit and Spec reporter output.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mocha-circleci-reporter Build Status

A Mocha reporter specifically for Circle CI.

Getting Started

Install the reporter as a development dependency:

npm install mocha --save-dev
npm install mocha-circleci-reporter --save-dev

Update your package.json to use the reporter when running Mocha:

{
  "name": "my-package",
  "version": "0.0.1",
  "scripts": {
    "test": "node_modules/.bin/mocha --reporter mocha-circleci-reporter test/*.js"
  }
}

Background

Why another reporter?

As of Mocha 2.x, its not possible to use multple reporters out of the box. This complicates things when dealing with CI systems like Circle CI that require a format such as jUnit XML as a lot of the goodness that is written to console when running the default reporter (Spec).

To overcome this, the mocha-circleci-reporter report combines both the builtin Spec and mocha-junit-report reporters.

Example spec output:

spec_output.jpg

Example jUnit output:

spec_output.jpg

Mocha 3.x

There is work underway in Mocha 3.x to move to a plugin architecture that would make multiple reporters dead simple, until then I hope this simplifies things.

mochajs/mocha#1457

About

A mocha reporter that supports Circle CI, via a combined jUnit and Spec reporter output.

License:MIT License


Languages

Language:JavaScript 100.0%