Skip to content

Commit

Permalink
fix(reporter): prevent deleting test reports stored in coverage direc…
Browse files Browse the repository at this point in the history
…tory
  • Loading branch information
AriPerkkio committed May 9, 2023
1 parent 0c4eb85 commit 51b0b30
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions packages/vitest/src/node/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,14 @@ export class Vitest {
return
}

await this.report('onInit', this)

await this.initCoverageProvider()
await this.coverageProvider?.clean(this.config.coverage.clean)
await this.initBrowserProviders()
try {
await this.initCoverageProvider()
await this.coverageProvider?.clean(this.config.coverage.clean)
await this.initBrowserProviders()
}
finally {
await this.report('onInit', this)
}

const files = await this.filterTestsBySource(
await this.globTestFiles(filters),
Expand Down

0 comments on commit 51b0b30

Please sign in to comment.