Posts your coverage reports to Optimized for TravisCI, and local builds

Downloads in past


1,064762.1.010 years ago10 years agoMinified + gzip package size for in KB


Codeship Status for xcambar/node-coveralls Coverage status support for node.js. Get the great coverage reporting of and add a cool coverage button to your README.
  • Add the latest version of coveralls to your package.json:
npm install coveralls --save
JSCover, node-jscoverage or any tool of your choosing
  • Run your test suites against the instrumented files, with Istanbul,
the Mocha LCOV Reporter, or, once again, the tool of your choosing
  • Run \npm bin\`/coveralls.js < /path/to/your/lcov\` require the presence of an environment variable called COVERALLS\_REPO\_TOKEN,
whic contains the secret token to post your coverage data. Make sure it is available in your Ci environment, or the whole bild will fail (node-coveralls will stop with a non-zero return code).
Setup example
In this repo, I used Istanbul and Mocha, and wrapped them all in the following npm scripts:
"scripts": {
  "test": "node ./test/runner.js",
  "coverage": "`npm bin`/istanbul cover ./test/runner.js",
  "coveralls": "npm run-script coverage && node bin/coveralls.js < coverage/"

The Ci environments they run into execute the task coveralls to send the data once the build is finished.

Supported CIs

Currently, node-coveralls can send data from 3 CI environments:

The two first offer a great level of integration, the third os yet to be polished, though the major info is available.

More CIs ?

Feel free to pull-request the integration of another CI, or simply ask, it may be just enough to see it implemented :wink:.
  • More CIs
  • Polish
  • Enhnce code coverage (of course!)