Skip to content

Commit

Permalink
Merge pull request #6 from matthew-andrews/optional-instrument
Browse files Browse the repository at this point in the history
Allow the developer to opt out of instrumentation - enable browserify + buster + istanbul
  • Loading branch information
mikaelkaron committed Jul 25, 2013
2 parents 2a7b7d3 + abdab75 commit 367ce2b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/buster-istanbul.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ function merge(paths) {
}

var setup = {
node: function(group) {
node: function(group, instrument) {
coverage.hookRequire();
if (instrument === false) return;
group.sources.forEach(function(pattern) {
glob.glob(pattern).forEach(function(fPath) {
coverage.addInstrumentCandidate(fPath);
Expand All @@ -44,6 +45,7 @@ var setup = {
});

group.on('load:sources', function(rs){
if (instrument === false) return;
rs.addProcessor(function(resource, content){
return coverage.instrumentCode(content, resource['path'].replace(/\//, ''));
});
Expand Down Expand Up @@ -86,7 +88,7 @@ module.exports = {
},

configure: function(group) {
setup[group.environment](group);
setup[group.environment](group, this.options.instrument);
var self = this;
process.on("exit", function() {
coverage.writeReports(self.options.outputDirectory);
Expand Down

0 comments on commit 367ce2b

Please sign in to comment.