Skip to content

Commit

Permalink
fix(coverage): reduce size of leftover v8 reports (#2144)
Browse files Browse the repository at this point in the history
  • Loading branch information
AriPerkkio committed Oct 14, 2022
1 parent 01ca7ad commit 8c80b8f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/coverage-c8/src/provider.ts
Expand Up @@ -102,6 +102,12 @@ export class C8CoverageProvider implements CoverageProvider {

await report.run()
await checkCoverages(this.options, report)

// Note that this will only clean up the V8 reports generated so far.
// There will still be a temp directory with some reports when vitest exists,
// but at least it will only contain reports of vitest's internal functions.
if (existsSync(this.options.tempDirectory))
await fs.rm(this.options.tempDirectory, { recursive: true, force: true })
}
}
function resolveC8Options(options: CoverageC8Options, root: string) {
Expand Down

0 comments on commit 8c80b8f

Please sign in to comment.