diff options
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/testdata/test/uncaught_errors.out | 16 | ||||
-rw-r--r-- | cli/tests/testdata/test/uncaught_errors_1.ts | 4 |
2 files changed, 18 insertions, 2 deletions
diff --git a/cli/tests/testdata/test/uncaught_errors.out b/cli/tests/testdata/test/uncaught_errors.out index 882a5d6dd..2eae72e21 100644 --- a/cli/tests/testdata/test/uncaught_errors.out +++ b/cli/tests/testdata/test/uncaught_errors.out @@ -1,6 +1,9 @@ -running 2 tests from ./test/uncaught_errors_1.ts +running 3 tests from ./test/uncaught_errors_1.ts foo 1 ... FAILED ([WILDCARD]) foo 2 ... ok ([WILDCARD]) +foo 3 ... +Uncaught error from ./test/uncaught_errors_1.ts FAILED +foo 3 ... cancelled (0ms) running 3 tests from ./test/uncaught_errors_2.ts bar 1 ... ok ([WILDCARD]) bar 2 ... FAILED ([WILDCARD]) @@ -15,6 +18,14 @@ error: Error: foo 1 message ^ at [WILDCARD]/test/uncaught_errors_1.ts:2:9 +./test/uncaught_errors_1.ts (uncaught error) +error: (in promise) Error: foo 3 message + Promise.reject(new Error("foo 3 message")); + ^ + at [WILDCARD]/test/uncaught_errors_1.ts:8:18 +This error was not caught from a test and caused the test runner to fail on the referenced module. +It most likely originated from a dangling promise, event/timeout handler or top-level code. + bar 2 => ./test/uncaught_errors_2.ts:3:6 error: Error: bar 2 throw new Error("bar 2"); @@ -38,10 +49,11 @@ It most likely originated from a dangling promise, event/timeout handler or top- FAILURES foo 1 => ./test/uncaught_errors_1.ts:1:6 +./test/uncaught_errors_1.ts (uncaught error) bar 2 => ./test/uncaught_errors_2.ts:3:6 bar 3 => ./test/uncaught_errors_2.ts:6:6 ./test/uncaught_errors_3.ts (uncaught error) -FAILED | 2 passed | 4 failed ([WILDCARD]) +FAILED | 2 passed | 6 failed ([WILDCARD]) error: Test failed diff --git a/cli/tests/testdata/test/uncaught_errors_1.ts b/cli/tests/testdata/test/uncaught_errors_1.ts index ea3c557e4..166b23ac3 100644 --- a/cli/tests/testdata/test/uncaught_errors_1.ts +++ b/cli/tests/testdata/test/uncaught_errors_1.ts @@ -3,3 +3,7 @@ Deno.test("foo 1", () => { }); Deno.test("foo 2", () => {}); + +Deno.test("foo 3", () => { + Promise.reject(new Error("foo 3 message")); +}); |