aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregg Caines <[email protected]>2013-06-21 10:20:51 -0700
committerGregg Caines <[email protected]>2013-06-21 10:20:51 -0700
commit35d261302059675a69e2cecdb84598f29f311fbb (patch)
tree35ee91096b872238c8ca04bccb418f3e55c8f71e
parent0e2d25ccd75f8241b02fa6d61c1dd9d7248962bf (diff)
downloadnode-coveralls-35d261302059675a69e2cecdb84598f29f311fbb.tar.xz
node-coveralls-35d261302059675a69e2cecdb84598f29f311fbb.zip
Update README.md
-rw-r--r--README.md22
1 files changed, 17 insertions, 5 deletions
diff --git a/README.md b/README.md
index ec7f8a7..4dde29a 100644
--- a/README.md
+++ b/README.md
@@ -2,25 +2,37 @@
[![Build Status](https://travis-ci.org/cainus/node-coveralls.png?branch=master)](https://travis-ci.org/cainus/node-coveralls)
[![Coverage Status](https://coveralls.io/repos/cainus/node-coveralls/badge.png?branch=master)](https://coveralls.io/r/cainus/node-coveralls?branch=master)
-[Coveralls.io](https://coveralls.io/) support for node.js. Get the great coverage reporting of coveralls.io and add a cool coverage button ( like this: ![](https://s3.amazonaws.com/assets.coveralls.io/badges/coveralls_94.png) ) to your README.
+[Coveralls.io](https://coveralls.io/) support for node.js. Get the great coverage reporting of coveralls.io and add a cool coverage button ( like the one above ) to your README.
-Installation: Add the latest version of `coveralls` to your package.json:
+##Installation:
+Add the latest version of `coveralls` to your package.json:
```
npm install coveralls --save
```
-This script ( `bin/coveralls.js` ) can take standard input from any tool that emits the lcov data format (including [mocha](http://visionmedia.github.com/mocha/)'s [LCov reporter](https://npmjs.org/package/mocha-lcov-reporter)) and send it to coveralls.io to report your code coverage there.
+If you're using mocha, add `mocha-lcov-reporter` to your package.json:
+```
+npm install mocha-lcov-reporter --save
+```
-Instrumenting your app for coverage is probably harder than it needs to be (read [here](http://www.seejohncode.com/2012/03/13/setting-up-mocha-jscoverage/) or [here](http://tjholowaychuk.com/post/18175682663/mocha-test-coverage)), but that's also a necessary step.
+##Usage:
+
+This script ( `bin/coveralls.js` ) can take standard input from any tool that emits the lcov data format (including [mocha](http://visionmedia.github.com/mocha/)'s [LCov reporter](https://npmjs.org/package/mocha-lcov-reporter)) and send it to coveralls.io to report your code coverage there.
Once your app is instrumented for coverage, and building, you just need to pipe the lcov output to `./node_modules/coveralls/bin/coveralls.js`.
+###JSCoverage
+
+Instrumenting your app for coverage is probably harder than it needs to be (read [here](http://www.seejohncode.com/2012/03/13/setting-up-mocha-jscoverage/) or [here](http://tjholowaychuk.com/post/18175682663/mocha-test-coverage)), but that's also a necessary step.
+
In mocha, if you've got your code instrumented for coverage, the command for a travis build would look something like this:
```console
YOURPACKAGE_COVERAGE=1 ./node_modules/.bin/mocha test -R mocha-lcov-reporter | ./node_modules/coveralls/bin/coveralls.js
```
-If you're running locally, you must have a `.coveralls.yml` file, as documented in their documentation, with your `repo_token` in it; or, you must provide a `COVERALLS_REPO_TOKEN` environment-variable on the command-line.
+## Running locally
+
+If you're running locally, you must have a `.coveralls.yml` file, as documented in [their documentation](https://coveralls.io/docs/ruby), with your `repo_token` in it; or, you must provide a `COVERALLS_REPO_TOKEN` environment-variable on the command-line.
Check out an example [Makefile](https://github.com/cainus/urlgrey/blob/master/Makefile) from one of my projects for an example, especially the test-coveralls build target. Note: Travis runs `npm test`, so whatever target you create in your Makefile must be the target that `npm test` runs (This is set in package.json's 'scripts' property).