Skip to content

Commit

Permalink
fix: clean coverage-c8 tmp useless files after reporting (fix vitest-…
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan committed Aug 26, 2022
1 parent 88d5764 commit 56a0aa6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/coverage-c8/src/provider.ts
Expand Up @@ -40,6 +40,11 @@ export class C8CoverageProvider implements CoverageProvider {
await fs.mkdir(this.options.tempDirectory, { recursive: true })
}

async cleanTmp() {
if (existsSync(this.options.tempDirectory))
await fs.rm(this.options.tempDirectory, { recursive: true, force: true })
}

onAfterSuiteRun() {
takeCoverage()
}
Expand Down Expand Up @@ -102,6 +107,7 @@ export class C8CoverageProvider implements CoverageProvider {

await report.run()
await checkCoverages(this.options, report)
await this.cleanTmp()
}
}
function resolveC8Options(options: CoverageC8Options, root: string) {
Expand Down

0 comments on commit 56a0aa6

Please sign in to comment.