buster-istanbul
Advanced tools
Comparing version 0.1.14 to 0.1.15
@@ -70,7 +70,10 @@ /* | ||
if (instrument === false) return; | ||
group.sources.forEach(function(pattern) { | ||
glob.sync(pattern).forEach(function(fPath) { | ||
var excluded = isExcluded(fPath, excludes); | ||
group.on('load:sources', function(rs){ | ||
var rootPath = rs.rootPath | ||
rs.forEach(function(resource){ | ||
var resourcePath = resource.path.replace(/\//, ''); | ||
var excluded = isExcluded(resourcePath, excludes); | ||
if (!excluded) { | ||
coverage.addInstrumentCandidate(fPath); | ||
coverage.addInstrumentCandidate(path.join(rootPath, resourcePath)); | ||
} | ||
@@ -95,8 +98,10 @@ }); | ||
group.on('load:sources', function(rs){ | ||
var rootPath = rs.rootPath; | ||
if (instrument === false) return; | ||
rs.addProcessor(function(resource, content){ | ||
var path = resource.path.replace(/\//, ''); | ||
var excluded = isExcluded(path, excludes); | ||
// properly join the path, using the rootPath | ||
var resourcePath = resource.path.replace(/\//, ''); | ||
var excluded = isExcluded(resourcePath, excludes); | ||
return excluded ? content : coverage.instrumentCode(content, path); | ||
return excluded ? content : coverage.instrumentCode(content, path.join(rootPath, resourcePath)); | ||
}); | ||
@@ -103,0 +108,0 @@ }); |
{ | ||
"name": "buster-istanbul", | ||
"description": "buster extension for istanbul code coverage.", | ||
"version": "0.1.14", | ||
"version": "0.1.15", | ||
"homepage": "https://github.com/englishtown/buster-istanbul", | ||
@@ -6,0 +6,0 @@ "author": { |
15172
318