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

Method registerUnhandledRejection

packages/vitest/src/node/logger.ts:369–387  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

367 }
368
369 private registerUnhandledRejection() {
370 const onUnhandledRejection = (err: unknown) => {
371 process.exitCode = 1
372
373 this.printError(err, {
374 fullStack: true,
375 type: 'Unhandled Rejection',
376 })
377
378 this.error('\n\n')
379 process.exit()
380 }
381
382 process.on('unhandledRejection', onUnhandledRejection)
383
384 this.ctx.onClose(() => {
385 process.off('unhandledRejection', onUnhandledRejection)
386 })
387 }
388}

Callers 1

constructorMethod · 0.95

Calls 3

onCloseMethod · 0.80
onMethod · 0.45
offMethod · 0.45

Tested by

no test coverage detected