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
Show file tree
Hide file tree
Changes from all commits
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
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,20 @@ coverageReporter: {
}
```

#### sourceStore
**Type:** istanbul.Store

You can opt to specify a source store allowing for external coverage collectors access to the instrumented code.

```javascript
coverageReporter: {
type : 'text',
dir : 'coverage/',
file : 'coverage.txt',
sourceStore : require('istanbul').Store.create('fslookup')
}
```

#### multiple reporters
You can use multiple reporters, by providing array of options.

Expand Down
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