Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: reporter allow using a externally provided source cachere for reporters #140

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: reporter allow using a externally provided source cachere for re…
…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
commit 781c126f32730ea79ef6ad3bd8bcfa8f311256b6
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