Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.reportAll = function() {
let reporter = new istanbul.Reporter();
reporter.addAll(["text"]);
console.log("Cummulative Coverage Report:");
reporter.write(accumulator, sync, function() {
// console.log("Cummulative report generated.");
});
};
};
module.exports = function (runner) {
const collector = new instanbul.Collector();
const reporter = new instanbul.Reporter();
new MochaSpecReporter(runner);
runner.on('end', function () {
collector.add(global.__coverage__);
reporter.addAll(['json', 'lcovonly']);
reporter.write(collector, true, function () {
process.stdout.write('report generated');
});
});
};
module.exports = function (runner) {
const collector = new instanbul.Collector();
const reporter = new instanbul.Reporter();
reporter.addAll(['lcov', 'json']);
new MochaSpecReporter(runner);
runner.on('end', function () {
collector.add(global.__coverage__);
reporter.write(collector, true, function () {
process.stdout.write('report generated');
});
});
};
gulp.task('coverage', function(done) {
var collector = new istanbul.Collector();
var reporter = new istanbul.Reporter(null, './coverage/report');
reporter.addAll(['lcov']);
glob("./coverage/json/**/coverage*.json", {}, function (err, files) {
files.forEach(function (file) {
var coverageObject = JSON.parse(fs.readFileSync(file, 'utf8'));
collector.add(coverageObject);
});
files.forEach(function(f) {
console.log('Adding coverage file '+f);
collector.add(JSON.parse(fs.readFileSync(f, 'utf8')));
});
reporter.write(collector, false, done);
});
});
module.exports = function (runner) {
const collector = new instanbul.Collector()
const reporter = new instanbul.Reporter()
reporter.addAll(['lcov', 'json'])
new MochaSpecReporter(runner)
runner.on('end', function () {
collector.add(global.__coverage__)
reporter.write(collector, true, function () {
console.log('report generated')
})
})
}