()
| 37 | } |
| 38 | |
| 39 | compileReport() { |
| 40 | let reporter: Reporter; |
| 41 | switch (this.type) { |
| 42 | case REPORT_TYPE.LOG: |
| 43 | console.error(chalk.red('Error in the following scenarios')); |
| 44 | this._errors.forEach(e => { |
| 45 | console.log(e.scenario); |
| 46 | console.log(e.descriptions); |
| 47 | }); |
| 48 | break; |
| 49 | case REPORT_TYPE.JSON: |
| 50 | const scenarioNames = this.scenarios.map(s => `${s.name}: ${s.description}`); |
| 51 | reporter = new JSONReporter(this.errors, scenarioNames); |
| 52 | writeFileSync(this.filename, reporter.getReport()); |
| 53 | break; |
| 54 | case REPORT_TYPE.XML: |
| 55 | reporter = new XMLReporter(this.errors, this.scenarios); |
| 56 | writeFileSync(this.filename, reporter.getReport()); |
| 57 | break; |
| 58 | } |
| 59 | } |
| 60 | } |
no test coverage detected