diff options
| author | cainus <[email protected]> | 2013-03-28 01:01:06 -0700 |
|---|---|---|
| committer | cainus <[email protected]> | 2013-03-28 01:01:06 -0700 |
| commit | 67effe59fbaefa65e69f5326c8bcd867537aea00 (patch) | |
| tree | becadb4f1ca17c906a997f039babc5214f111018 | |
| parent | c04a6beffc37a0c8fa3a06e628d95f11366db915 (diff) | |
| download | node-coveralls-67effe59fbaefa65e69f5326c8bcd867537aea00.tar.xz node-coveralls-67effe59fbaefa65e69f5326c8bcd867537aea00.zip | |
fix README. fix off-by-one error. version bump 2.0.4.
| -rw-r--r-- | README.md | 6 | ||||
| -rw-r--r-- | lib/convertLcovToCoveralls.js | 2 | ||||
| -rw-r--r-- | package.json | 2 |
3 files changed, 5 insertions, 5 deletions
@@ -4,11 +4,11 @@ Installation: Add the latest version of `coveralls` to your package.json. -This script ( `bin/coveralls.js` ) can take standard input in the JSON format from [mocha](http://visionmedia.github.com/mocha/)'s JSONCov reporter and send it to coveralls.io to report your code coverage there. It needs to run from [travis-ci](http://about.travis-ci.org/docs/user/languages/javascript-with-nodejs/) to work. +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. It needs to run from [travis-ci](http://about.travis-ci.org/docs/user/languages/javascript-with-nodejs/) to work. 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. -Once your app is instrumented for coverage, and building in travis-ci, you just need to set your mocha reporter to the JSONCov reporter, and pipe the output to `./node_modules/coveralls/bin/coveralls.js`. +Once your app is instrumented for coverage, and building in travis-ci, you just need to pipe the lcov output to `./node_modules/coveralls/bin/coveralls.js`. -Check out an example [Makefile](https://github.com/cainus/Prozess/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. Also note that the TRAVIS_JOB_ID is necessary. +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. Also note that the TRAVIS_JOB_ID is necessary. diff --git a/lib/convertLcovToCoveralls.js b/lib/convertLcovToCoveralls.js index c390aab..14d637e 100644 --- a/lib/convertLcovToCoveralls.js +++ b/lib/convertLcovToCoveralls.js @@ -6,7 +6,7 @@ var path = require('path'); var detailsToCoverage = function(length, details){ var coverage = new Array(length); details.forEach(function(obj){ - coverage[obj.line] = obj.hit; + coverage[obj.line - 1] = obj.hit; }); return coverage; }; diff --git a/package.json b/package.json index 2cb0013..19245cd 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "coveralls", "description" : "takes json-cov output into stdin and POSTs to coveralls.io", "keywords" : ["coverage", "coveralls"], - "version": "2.0.3", + "version": "2.0.4", "bugs": { "url": "https://github.com/cainus/node-coveralls/issues" }, |
