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

Method onExit

packages/vitest/src/node/logger.ts:344–355  ·  view source on GitHub ↗
(signal?: string | number, exitCode?: number)

Source from the content-addressed store, hash-verified

342 }
343
344 const onExit = (signal?: string | number, exitCode?: number) => {
345 cleanup()
346
347 // Interrupted signals don't set exit code automatically.
348 // Use same exit code as node: https://nodejs.org/api/process.html#signal-events
349 if (process.exitCode === undefined) {
350 process.exitCode = exitCode !== undefined ? (128 + exitCode) : Number(signal)
351 }
352
353 // Timeout to flush stderr
354 setTimeout(() => process.exit(), 1)
355 }
356
357 process.once('SIGINT', onExit)
358 process.once('SIGTERM', onExit)

Callers

nothing calls this directly

Calls 2

exitMethod · 0.80
cleanupFunction · 0.50

Tested by

no test coverage detected