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

Function runUnhandledTest

test/cli/test/unhandled-rejections.test.ts:35–47  ·  view source on GitHub ↗
(config: RunVitestConfig)

Source from the content-addressed store, hash-verified

33 })
34
35 function runUnhandledTest(config: RunVitestConfig) {
36 return runInlineTests({
37 'throw-errors.test.js': /* js */`
38 import { test } from "vitest"
39
40 test("Some test", () => {
41 //
42 })
43
44 new Promise((_, reject) => reject(new Error("intentional unhandled error")))
45 `,
46 }, config, { fails: true })
47 }
48})
49
50test('unhandled rejections of main thread are reported even when no reporter is used', async () => {

Callers 1

Calls 1

runInlineTestsFunction · 0.70

Tested by

no test coverage detected