Skip to content

Commit

Permalink
fix: reporter allow using a externally provided source cachere for re…
Browse files Browse the repository at this point in the history
…porters

change `coverageReporter` options to allow for specifying `sourceStore`, this
is an instance of `istanbul.Store` to look up source files. This allows using
external coverage collectors like `browserify-istanbul` for instrumenting code.
  • Loading branch information
weikinhuang committed Apr 7, 2015
1 parent 8c3f2a8 commit f7f8957
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/reporter.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,12 @@ var CoverageReporter = function(rootConfig, helper, logger) {
reporterConfig.dir || config.dir,
reporterConfig.subdir || config.subdir)));

var options = helper.merge({}, reporterConfig, {
dir : outputDir,
var options = helper.merge({
sourceStore : new SourceCacheStore({
sourceCache: sourceCache
})
}, reporterConfig, {
dir : outputDir
});
var reporter = istanbul.Report.create(reporterConfig.type || 'html', options);

Expand Down

0 comments on commit f7f8957

Please sign in to comment.