1 | var Report = require('istanbul').Report
|
2 | var util = require('util')
|
3 |
|
4 | function InMemoryReport (opt) {
|
5 | this.opt = opt
|
6 | }
|
7 |
|
8 | util.inherits(InMemoryReport, Report)
|
9 |
|
10 | InMemoryReport.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 |
|
18 | InMemoryReport.TYPE = 'in-memory'
|
19 |
|
20 | module.exports = InMemoryReport
|