From 23efc4fcab2ca3b8b47539a7fb1d904efc57eb7c Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Mon, 9 May 2022 10:44:50 +0100 Subject: feat(test): Represent uncaught errors (#14513) This commit adds better reporting of uncaught errors in top level scope of testing files. This change affects both console runner as well as LSP runner. --- cli/tests/testdata/test/no_check.out | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'cli/tests/testdata/test/no_check.out') diff --git a/cli/tests/testdata/test/no_check.out b/cli/tests/testdata/test/no_check.out index 9daab7ac4..3e1c93535 100644 --- a/cli/tests/testdata/test/no_check.out +++ b/cli/tests/testdata/test/no_check.out @@ -1,8 +1,19 @@ +Uncaught error from ./test/no_check.ts FAILED -test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) + ERRORS -error: Uncaught TypeError: Cannot read properties of undefined (reading 'fn') +./test/no_check.ts (uncaught error) +error: TypeError: Cannot read properties of undefined (reading 'fn') Deno.test(); ^ - at [WILDCARD] at [WILDCARD]/test/no_check.ts:1:6 +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. + + FAILURES + +./test/no_check.ts (uncaught error) + +test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) + +error: Test failed -- cgit v1.2.3