UNPKG

606 BJavaScriptView Raw
1var Report = require('istanbul').Report
2var util = require('util')
3
4function InMemoryReport (opt) {
5 this.opt = opt
6}
7
8util.inherits(InMemoryReport, Report)
9
10InMemoryReport.prototype.writeReport = function (collector, sync) {
11 if (!this.opt.emitter || !this.opt.emitter.emit) {
12 console.error('Could not raise "coverage_complete" event, missing emitter because it was not supplied during initialization of the reporter')
13 } else {
14 this.opt.emitter.emit('coverage_complete', this.opt.browser, collector.getFinalCoverage())
15 }
16}
17
18InMemoryReport.TYPE = 'in-memory'
19
20module.exports = InMemoryReport