(mode: VitestRunMode, cliFilters: string[], options: CliOptions)
| 304 | } |
| 305 | |
| 306 | async function start(mode: VitestRunMode, cliFilters: string[], options: CliOptions): Promise<void> { |
| 307 | try { |
| 308 | const { startVitest } = await import('./cli-api') |
| 309 | const ctx = await startVitest(mode, cliFilters.map(normalize), normalizeCliOptions(cliFilters, options)) |
| 310 | if (!ctx.shouldKeepServer()) { |
| 311 | await ctx.exit() |
| 312 | } |
| 313 | } |
| 314 | catch (e) { |
| 315 | const { errorBanner } = await import('../reporters/renderers/utils') |
| 316 | console.error(`\n${errorBanner('Startup Error')}`) |
| 317 | console.error(e) |
| 318 | console.error('\n\n') |
| 319 | |
| 320 | if (process.exitCode == null) { |
| 321 | process.exitCode = 1 |
| 322 | } |
| 323 | |
| 324 | process.exit() |
| 325 | } |
| 326 | } |
| 327 | |
| 328 | async function init(project: string) { |
| 329 | if (project !== 'browser') { |
no test coverage detected