Skip to content

Commit c926ea0

Browse files
committed
Default reporters lcov, json with a way to specify it from runner
1 parent e63841c commit c926ea0

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

lib/coverage.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ var path = require('path'),
44
var istanbul,
55
collector,
66
options = {
7-
dir: 'coverage'
7+
dir: 'coverage',
8+
reporters: ['lcov', 'json']
89
};
910

1011
try {
@@ -38,7 +39,11 @@ exports.report = function() {
3839

3940
if (collector) {
4041
Report = istanbul.Report;
41-
reports = [Report.create('lcov', options), Report.create('json', options)];
42+
43+
reports = options.reporters.map(function (report) {
44+
return Report.create(report, options);
45+
});
46+
4247
reports.forEach(function(rep) {
4348
rep.writeReport(collector, true);
4449
});

0 commit comments

Comments
 (0)