Skip to content

Commit

Permalink
fix(workspace): throw error when browser mode and `@vitest/coverage-v…
Browse files Browse the repository at this point in the history
…8` are used
  • Loading branch information
AriPerkkio committed Feb 24, 2024
1 parent 5bb8b38 commit 1551a3c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/vitest/src/node/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,10 @@ export class Vitest {
names.add(name)
}

const isAnyProjectBrowser = resolvedProjects.some(project => project.config.browser.enabled)
if (isAnyProjectBrowser && this.config.coverage.enabled && this.config.coverage.provider === 'v8')
throw new Error('@vitest/coverage-v8 does not work with --browser. Use @vitest/coverage-istanbul instead')

return resolvedProjects
}

Expand Down

0 comments on commit 1551a3c

Please sign in to comment.