Skip to content

Commit

Permalink
fix: don't exit process if config failed
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed May 13, 2024
1 parent 9eb8475 commit 6a0778d
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions packages/vitest/src/node/plugins/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,15 +193,9 @@ export async function VitestPlugin(options: UserConfig = {}, ctx = new Vitest('t
console.log('[debug] watcher is ready')
})
}
try {
await ctx.setServer(options, server, userConfig)
if (options.api && options.watch)
(await import('../../api/setup')).setup(ctx)
}
catch (err) {
ctx.logger.printError(err, { fullStack: true })
process.exit(1)
}
await ctx.setServer(options, server, userConfig)
if (options.api && options.watch)
(await import('../../api/setup')).setup(ctx)

// #415, in run mode we don't need the watcher, close it would improve the performance
if (!options.watch)
Expand Down

0 comments on commit 6a0778d

Please sign in to comment.