()
| 65 | } |
| 66 | |
| 67 | async onTestRunEnd(): Promise<void> { |
| 68 | const result: HTMLReportData = { |
| 69 | paths: this.ctx.state.getPaths(), |
| 70 | files: this.ctx.state.getFiles(), |
| 71 | config: this.ctx.serializedRootConfig, |
| 72 | unhandledErrors: this.ctx.state.getUnhandledErrors(), |
| 73 | moduleGraph: {}, |
| 74 | sources: {}, |
| 75 | } |
| 76 | const promises: Promise<void>[] = [] |
| 77 | |
| 78 | promises.push(...result.files.map(async (file) => { |
| 79 | const projectName = file.projectName || '' |
| 80 | const resolvedConfig = this.ctx.getProjectByName(projectName).config |
| 81 | const browser = resolvedConfig.browser.enabled |
| 82 | result.moduleGraph[projectName] ??= {} |
| 83 | result.moduleGraph[projectName][file.filepath] = await getModuleGraph( |
| 84 | this.ctx, |
| 85 | projectName, |
| 86 | file.filepath, |
| 87 | browser, |
| 88 | ) |
| 89 | if (!result.sources[file.filepath]) { |
| 90 | try { |
| 91 | result.sources[file.filepath] = await fs.readFile(file.filepath, { |
| 92 | encoding: 'utf-8', |
| 93 | }) |
| 94 | } |
| 95 | catch { |
| 96 | // just ignore |
| 97 | } |
| 98 | } |
| 99 | })) |
| 100 | |
| 101 | await Promise.all(promises) |
| 102 | await this.writeReport(stringify(result)) |
| 103 | } |
| 104 | |
| 105 | async writeReport(report: string): Promise<void> { |
| 106 | const metaFile = resolve(this.reporterDir, 'html.meta.json.gz') |
nothing calls this directly
no test coverage detected