Skip to content

Commit

Permalink
fix(coverage): remove coverage/.tmp files after run (#5008)
Browse files Browse the repository at this point in the history
  • Loading branch information
AriPerkkio committed Jan 19, 2024
1 parent 538975e commit d53b858
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/coverage-v8/src/provider.ts
Expand Up @@ -235,10 +235,10 @@ export class V8CoverageProvider extends BaseCoverageProvider implements Coverage
},
})
}

this.coverageFiles = new Map()
await fs.rm(this.coverageFilesDirectory, { recursive: true })
}

this.coverageFiles = new Map()
await fs.rm(this.coverageFilesDirectory, { recursive: true })
}

private async getUntestedFiles(testedFiles: string[]): Promise<RawCoverage> {
Expand Down
Expand Up @@ -184,3 +184,10 @@ test('multi environment coverage is merged correctly', async () => {
// Condition covered by both tests
expect(lineCoverage[30]).toBe(2)
})

test('temporary files are removed after test', async () => {
const coveragePath = resolve('./coverage')
const files = fs.readdirSync(coveragePath)

expect(files).not.toContain('.tmp')
})

0 comments on commit d53b858

Please sign in to comment.