(runner: Runner, _options: any)
| 6 | |
| 7 | export class CoverageReporter extends reporters.Base { |
| 8 | constructor(runner: Runner, _options: any) { |
| 9 | super(runner); |
| 10 | |
| 11 | runner.once("end", () => { |
| 12 | try { |
| 13 | if (typeof __coverage__ !== "undefined" && typeof process.env.COVERAGE_OUTPUT !== "undefined" && process.env.COVERAGE_OUTPUT) { |
| 14 | fs.writeFileSync(process.env.COVERAGE_OUTPUT, JSON.stringify(__coverage__)); |
| 15 | } |
| 16 | } catch (e) { |
| 17 | console.error("Failed to write coverage!"); |
| 18 | console.error(e); |
| 19 | } |
| 20 | }); |
| 21 | } |
| 22 | } |