Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports = function (server, coverageObject) {
// TODO html-cov etc.
var report = istanbul.Report.create('text');
var collector = new istanbul.Collector();
collector.add(coverageObject);
report.writeReport(collector);
};
var hook = exports.hook = function (server, coverageObject) {
var config = server.config.coverage;
if(config) {
// TODO html-cov etc.
var report = istanbul.Report.create('text');
var collector = new istanbul.Collector();
collector.add(coverageObject);
report.writeReport(collector);
}
};
this.onBrowserStart = function (browser) {
if (!collectors[browser[aggregator]]) { // ADDED BY KARMA-SHARDING
collectors[browser[aggregator]] = new istanbul.Collector(); // CHANGE MADE BY KARMA-SHARDING
if (!includeAllSources) return;
collectors[browser[aggregator]].add(coverageMap.get()); // CHANGE MADE BY KARMA-SHARDING
} // ADDED BY KARMA-SHARDING
};
function Listener(emitter, pluginOptions) {
this.options = pluginOptions;
this.collector = new istanbul.Collector();
this.reporter = new istanbul.Reporter(false, this.options.dir);
this.validator = new Validator(this.options.thresholds);
this.reporter.addAll(this.options.reporters)
emitter.on('sub-suite-end', function(browser, data) {
if (data && data.__coverage__) {
this.collector.add(data.__coverage__);
}
}.bind(this));
emitter.on('run-end', function(error) {
if (!error) {
this.reporter.write(this.collector, sync, function() {});
if (!validator.validate(this.collector)) {
throw new Error('Coverage failed');
function Listener(emitter, pluginOptions) {
this.options = pluginOptions;
this.collector = new istanbul.Collector();
this.reporter = new istanbul.Reporter(false, this.options.dir);
this.validator = new Validator(this.options.thresholds);
this.reporter.addAll(this.options.reporters)
emitter.on('sub-suite-end', function(browser, data) {
if (data.__coverage__) {
this.collector.add(data.__coverage__);
}
}.bind(this));
emitter.on('run-end', function(error) {
if (!error) {
this.reporter.write(this.collector, sync, function() {});
if (!validator.validate(this.collector)) {
throw new Error('Coverage failed');
.then(function (coverage) {
var reporter = istanbul.Report.create("lcov");
var collector = new istanbul.Collector();
collector.add(coverage);
console.log("Writing coverage reports.");
reporter.writeReport(collector);
});
})
runner.on('end', () => {
const cov = global.__coverage__ || {};
const collector = new istanbul.Collector();
collector.add(cov);
reporters.forEach((reporter) => {
istanbul.Report.create(reporter, reporterOpts).writeReport(collector, true);
});
});
};
function combine(output: string): void {
const collector = new istanbul.Collector();
const coveragePaths = ['kernel', 'runtime', 'jit']
.map(p => join(project.coverage.path, p, 'coverage-final.json'));
for (const coveragePath of coveragePaths) {
if (existsSync(coveragePath)) {
const json = JSON.parse(readFileSync(coveragePath, 'utf8'));
collector.add(json);
}
}
istanbul.Report.create(output, opts).writeReport(collector);
}
config.onPrepare = _.wrap(config.onPrepare, function(onPrepare) {
onPrepare();
protractor.collector = new istanbul.Collector();
});
function (options) {
this.__super();
log4js.setGlobalLogLevel('INFO');
this._options = options || {};
this._taskDecoratorList = {};
this._clientDecoratorList = {};
this._taskList = {};
this._reportManager = null;
this._coverageCollector = new istanbul.Collector();
this.initialize();
},