diff options
| author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2022-05-09 10:44:50 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-09 11:44:50 +0200 |
| commit | 23efc4fcab2ca3b8b47539a7fb1d904efc57eb7c (patch) | |
| tree | 54dd76ef9d2071245c9ad28610f78c72937546eb /cli/tests/testdata/compat | |
| parent | ab728e9ccfff2d1ac6362b22b579b00120a39f67 (diff) | |
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.
Diffstat (limited to 'cli/tests/testdata/compat')
| -rw-r--r-- | cli/tests/testdata/compat/test_runner/top_level_fail_cjs.out | 20 | ||||
| -rw-r--r-- | cli/tests/testdata/compat/test_runner/top_level_fail_esm.out | 20 |
2 files changed, 34 insertions, 6 deletions
diff --git a/cli/tests/testdata/compat/test_runner/top_level_fail_cjs.out b/cli/tests/testdata/compat/test_runner/top_level_fail_cjs.out index 2d1471d63..be3c1b93b 100644 --- a/cli/tests/testdata/compat/test_runner/top_level_fail_cjs.out +++ b/cli/tests/testdata/compat/test_runner/top_level_fail_cjs.out @@ -1,7 +1,9 @@ +Uncaught error from ./compat/test_runner/top_level_fail_cjs.js FAILED -test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) + ERRORS -error: Uncaught (in promise) AssertionError: Values are not strictly equal: +./compat/test_runner/top_level_fail_cjs.js (uncaught error) +error: (in promise) AssertionError: Values are not strictly equal: [Diff] Actual / Expected @@ -10,4 +12,16 @@ error: Uncaught (in promise) AssertionError: Values are not strictly equal: - 10 + 20 -[WILDCARD]
\ No newline at end of file + Error.captureStackTrace(this, stackStartFn || stackStartFunction); + ^ + at [WILDCARD] +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 + +./compat/test_runner/top_level_fail_cjs.js (uncaught error) + +test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) + +error: Test failed diff --git a/cli/tests/testdata/compat/test_runner/top_level_fail_esm.out b/cli/tests/testdata/compat/test_runner/top_level_fail_esm.out index 04baeec2b..b4b313208 100644 --- a/cli/tests/testdata/compat/test_runner/top_level_fail_esm.out +++ b/cli/tests/testdata/compat/test_runner/top_level_fail_esm.out @@ -1,7 +1,9 @@ +Uncaught error from ./compat/test_runner/top_level_fail_esm.mjs FAILED -test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) + ERRORS -error: Uncaught AssertionError: Values are not strictly equal: +./compat/test_runner/top_level_fail_esm.mjs (uncaught error) +error: AssertionError: Values are not strictly equal: [Diff] Actual / Expected @@ -10,4 +12,16 @@ error: Uncaught AssertionError: Values are not strictly equal: - 10 + 20 -[WILDCARD]
\ No newline at end of file + Error.captureStackTrace(this, stackStartFn || stackStartFunction); + ^ + at [WILDCARD] +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 + +./compat/test_runner/top_level_fail_esm.mjs (uncaught error) + +test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) + +error: Test failed |
