MCPcopy
hub / github.com/vitest-dev/vitest / start

Function start

packages/vitest/src/node/cli/cac.ts:306–326  ·  view source on GitHub ↗
(mode: VitestRunMode, cliFilters: string[], options: CliOptions)

Source from the content-addressed store, hash-verified

304}
305
306async 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
328async function init(project: string) {
329 if (project !== 'browser') {

Callers 5

createCLIFunction · 0.70
runRelatedFunction · 0.70
watchFunction · 0.70
runFunction · 0.70
benchmarkFunction · 0.70

Calls 6

normalizeCliOptionsFunction · 0.85
errorBannerFunction · 0.85
shouldKeepServerMethod · 0.80
exitMethod · 0.80
errorMethod · 0.80
startVitestFunction · 0.70

Tested by

no test coverage detected