Skip to content

Commit

Permalink
fix: fix process exit timing
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Feb 22, 2022
1 parent 518e3dd commit 4c9dbd0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/vitest/src/node/cli-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,12 @@ export async function startVitest(cliFilters: string[], options: CliOptions, vit
ctx.error(`\n${c.red(divider(c.bold(c.inverse(' Unhandled Error '))))}`)
await printError(e, ctx)
ctx.error('\n\n')
return false
}
finally {
if (!ctx.config.watch)
await ctx.exit()

if (!ctx.config.watch) {
await ctx.exit()
return !process.exitCode
}

return true
}

0 comments on commit 4c9dbd0

Please sign in to comment.