This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Make node-cover a dev dependency, and refer to the locally installed …

…jake in the README
  • Loading branch information...
stenington committed Sep 3, 2013
1 parent b3440ca commit 3915570c5b400f52bcea3d69fc3d6e5713fc4aa3
Showing with 18 additions and 6 deletions.
  1. +8 −3 Jakefile
  2. +8 −2 README.md
  3. +2 −1 package.json
View
@@ -1,9 +1,14 @@
var path = require('path');
var fs = require('fs');
+const COVER = path.join('.', 'node_modules', '.bin', 'cover');
const TEST_DIR = path.join('.', 'test');
const SLEEP = 1000; // delay between `cover run`s and `cover combine`
+function cover(subCmd) {
+ return COVER + ' ' + subCmd;
+}
+
desc('Clean and run test coverage');
task('default', ['clean', 'test-cov']);
@@ -37,7 +42,7 @@ task('test-cov', {async: true}, function () {
}
var coverCmds = files.map(function(file){
- return 'cover run ' + file;
+ return cover('run ' + file);
});
jake.logger.log('Executing commands:\n\t' + coverCmds.join('\n\t'));
@@ -46,8 +51,8 @@ task('test-cov', {async: true}, function () {
// Sleeping seems to ensure that `cover combine` sees all of the runs
setTimeout(function(){
var cmds = [
- 'cover combine',
- 'cover report html'
+ cover('combine'),
+ cover('report html')
];
jake.logger.log('Executing commands:\n\t' + cmds.join('\n\t'));
jake.exec(cmds, function() {
View
@@ -102,8 +102,14 @@ email addresses may be supported.)
All tests can be run with `npm test`.
-If you have `node-cover` installed, a code coverage report can be generated
-with `grunt test-cov` and viewed in `cover_html/index.html`.
+A code coverage report can be generated with `node_modules/.bin/jake test-cov`
+(or `jake test-cov` if you have [jake][] installed globally)
+and viewed in `cover_html/index.html`.
+
+The coverage tool used is [node-cover][], see its documentation for details.
+
+[jake]: https://github.com/mde/jake
+[node-cover]: https://github.com/itay/node-cover
# License
View
@@ -19,7 +19,8 @@
"tap": "~0.4.0",
"underscore": "~1.5.1",
"sinon": "~1.7.3",
- "jake": "~0.6.11"
+ "jake": "~0.6.11",
+ "cover": "0.2.9"
},
"engines": {
"node": "~0.10.0"

0 comments on commit 3915570

Please sign in to comment.