Skip to content

Commit

Permalink
fix: try fix node crash (#335)
Browse files Browse the repository at this point in the history
Co-authored-by: Anthony Fu <[email protected]>
  • Loading branch information
Demivan and antfu authored Dec 27, 2021
1 parent f7bdb90 commit 5f095eb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/vitest/src/node/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,10 @@ async function run(cliFilters: string[], options: UserConfig) {
await ctx.close()
}

if (!ctx.config.watch)
process.exit()
if (!ctx.config.watch) {
// force process exit if it hangs
setTimeout(() => process.exit(), 1000).unref()
}
}

function registerConsoleShortcuts(ctx: Vitest) {
Expand Down

0 comments on commit 5f095eb

Please sign in to comment.