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 Jun 9, 2015
1 parent d37d90f commit 781c126
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,12 @@ var CoverageReporter = function(rootConfig, helper, logger) {
reporterConfig.dir || config.dir,
reporterConfig.subdir || config.subdir)));
var _ = helper._;
var options = helper.merge({}, config, reporterConfig, {
dir : outputDir,
var options = helper.merge({
sourceStore : _.isEmpty(sourceCache) ? null : new SourceCacheStore({
sourceCache: sourceCache
})
}, config, reporterConfig, {
dir : outputDir
});
var reporter = istanbul.Report.create(reporterConfig.type || 'html', options);

Expand Down

0 comments on commit 781c126

Please sign in to comment.