From 781c126f32730ea79ef6ad3bd8bcfa8f311256b6 Mon Sep 17 00:00:00 2001 From: Wei Kin Huang Date: Tue, 7 Apr 2015 18:25:15 -0400 Subject: [PATCH] fix: reporter allow using a externally provided source cachere for reporters 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. --- lib/reporter.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/reporter.js b/lib/reporter.js index 9ccbe56..2883600 100644 --- a/lib/reporter.js +++ b/lib/reporter.js @@ -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);