Skip to content

Commit

Permalink
support added to ignore code coverage using -ci option
Browse files Browse the repository at this point in the history
eg:- nodeunit -ci tests/
package.json updated with dependencies
  • Loading branch information
arunoda committed May 28, 2011
1 parent 72f5425 commit a920234
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions bin/nodeunit
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ var args = process.ARGV.slice(2);

//global indicators for Code Coverage
codeCoverage = {};
codeCoverage.paths = ['lib-cov'];

var files = [];

Expand Down Expand Up @@ -87,6 +88,9 @@ args.forEach(function (arg) {
codeCoverage.verbose = true;
} else if(arg === '-cr') {
codeCoverage.verbose = true;
} else if(arg === '-ci') {

This comment has been minimized.

Copy link
@Raynos

Raynos Dec 23, 2011

Rather then having a code coverage ignore option, can we just not enable code coverage by default?

This comment has been minimized.

Copy link
@arunoda

arunoda via email Dec 23, 2011

Author Owner

This comment has been minimized.

Copy link
@Raynos

Raynos Dec 23, 2011

Yes but your asking to merge something in, where thousands of people use it. And now all these thousands of people will be spawning code coverage by default.

Thats a major breaking change. You can't just introduce that and expect it to get merged.

It's not about personal preferences, It's about how can we introduce non breaking changes gently.

This comment has been minimized.

Copy link
@arunoda

arunoda via email Dec 23, 2011

Author Owner
codeCoverage.ignored = true;
codeCoverage.paths = ['lib'];
} else {
codeCoverage.enabled = true;
setUpCodeCoverage();
Expand Down
7 changes: 5 additions & 2 deletions lib/nodeunit.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,11 @@ exports.runFiles = function (paths, opt) {
return options.done(types.assertionList(all_assertions));
}

if(codeCoverage.enabled) {
require.paths.unshift('lib-cov');
if(codeCoverage) {
codeCoverage.paths.forEach(function(path) {
require.paths.unshift(path);
});

}

utils.modulePaths(paths, function (err, files) {
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,7 @@
]
, "directories" : { "lib": "./lib", "doc" : "./doc", "man" : "./man1" }
, "bin" : { "nodeunit" : "./bin/nodeunit" }
, "dependencies": {
"qbox": ">= 0.1.3"
}
}

0 comments on commit a920234

Please sign in to comment.