(coverageMap: CoverageMap, allTestsRun?: boolean)
| 101 | } |
| 102 | |
| 103 | async generateReports(coverageMap: CoverageMap, allTestsRun?: boolean): Promise<void> { |
| 104 | if (provider === 'stackblitz') { |
| 105 | this.ctx.logger.log( |
| 106 | c.blue(' % ') |
| 107 | + c.yellow( |
| 108 | '@vitest/coverage-v8 does not work on Stackblitz. Report will be empty.', |
| 109 | ), |
| 110 | ) |
| 111 | } |
| 112 | |
| 113 | const context = libReport.createContext({ |
| 114 | dir: this.options.reportsDirectory, |
| 115 | coverageMap, |
| 116 | watermarks: this.options.watermarks, |
| 117 | }) |
| 118 | |
| 119 | if (this.hasTerminalReporter(this.options.reporter)) { |
| 120 | this.ctx.logger.log( |
| 121 | c.blue(' % ') + c.dim('Coverage report from ') + c.yellow(this.name), |
| 122 | ) |
| 123 | } |
| 124 | |
| 125 | for (const reporter of this.options.reporter) { |
| 126 | // Type assertion required for custom reporters |
| 127 | reports |
| 128 | .create(reporter[0] as Parameters<typeof reports.create>[0], { |
| 129 | skipFull: this.options.skipFull, |
| 130 | projectRoot: this.ctx.config.root, |
| 131 | ...reporter[1], |
| 132 | }) |
| 133 | .execute(context) |
| 134 | } |
| 135 | |
| 136 | if (this.options.thresholds) { |
| 137 | await this.reportThresholds(coverageMap, allTestsRun) |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | async parseConfigModule(configFilePath: string): Promise<ProxifiedModule<any>> { |
| 142 | const contents = await fs.readFile(configFilePath, 'utf8') |
nothing calls this directly
no test coverage detected