Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(coverage): reduce size of leftover v8 reports #2144

Merged
merged 1 commit into from Oct 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More details about this here: #2108 (comment)

// 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