A mocha/blanket reporter for travis, will fail build when coverage is below a certain threshold
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE-MIT
README.md
console_runner.js
index.js
package.json Update version Jan 26, 2014
phantom_jasmine_runner.js
phantom_mocha_runner.js Added mocha runner and updated version Dec 7, 2012
phantom_runner.js
travisCov.js No more global/local Nov 25, 2012

README.md

travis-cov

A coverage reporter for Mocha/Blanket that will fail a travis-ci build when the coverage threshold is too low.

Threshold is specified in the package.json file of the consuming project.

Add the key `"travis-cov" to the "config" key in your package.json file. Under that key you can add any of the following properties:

threshold: <number>, global: <boolean>, local: <boolean>

See Blanket.js's package.json as an example.

usage

  1. npm install travis-cov
  2. Use a reporter argument, mocha -R travis-cov
  3. Change scripts.test in your package.json file to use mocha -R travis-cov
  4. Add travis-cov to the package.json file in the config section. Add whichever keys you want (see above).
  5. Set up your project with travis-ci
  6. Commit, if your tests pass and the code coverage is above the threshold the build will pass, otherwise it will fail.