Skip to content

Commit

Permalink
fix: report coverage even when no tests found
Browse files Browse the repository at this point in the history
  • Loading branch information
AriPerkkio committed Mar 28, 2023
1 parent 0f44d2c commit 0d2f482
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vitest/src/node/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ export function resolveConfig(
}

export function isBrowserEnabled(config: ResolvedConfig) {
if (config.browser.enabled)
if (config.browser?.enabled)
return true

return config.poolMatchGlobs?.length && config.poolMatchGlobs.some(([, pool]) => pool === 'browser')
Expand Down
1 change: 1 addition & 0 deletions packages/vitest/src/node/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ export class Vitest {
if (!files.length) {
const exitCode = this.config.passWithNoTests ? 0 : 1

await this.reportCoverage(true)
this.logger.printNoTestFound(filters)

process.exit(exitCode)
Expand Down

0 comments on commit 0d2f482

Please sign in to comment.