Skip to content

Commit

Permalink
Merge pull request #140 from weikinhuang/fix-browserify-istanbul-reports
Browse files Browse the repository at this point in the history
fix: reporter allow using a externally provided source cachere for reporters
  • Loading branch information
dignifiedquire committed Jun 9, 2015
2 parents aeefe4c + 9b1517f commit 1393291
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
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

0 comments on commit 1393291

Please sign in to comment.