diff options
| author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2022-11-28 23:07:23 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-28 23:07:23 +0100 |
| commit | f526513d74d34ac254aa40ef9b73238cb21c395b (patch) | |
| tree | 066e2c3685e33f611d2d38b04d49b01e4604573a /cli/tests/testdata/test | |
| parent | fd51b2e506f3ea3cc49bfb2bcb19bc684f563f60 (diff) | |
feat(core): show unresolved promise origin (#16650)
This commit updates unhelpful messages that are raised when event loop
stalls on unresolved top-level promises.
Instead of "Module evaluation is still pending but there are no pending
ops or dynamic imports. This situation is often caused by unresolved
promises." and "Dynamically imported module evaluation is still pending
but there are no pending ops. This situation is often caused by
unresolved promises." we are now printing a message like:
error: Top-level await promise never resolved
[SOURCE LINE]
^
at [FUNCTION NAME] ([FILENAME])
eg:
error: Top-level await promise never resolved
await new Promise((_resolve, _reject) => {});
^
at <anonymous>
(file:///Users/ib/dev/deno/cli/tests/testdata/test/unresolved_promise.ts:1:1)
Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
Diffstat (limited to 'cli/tests/testdata/test')
| -rw-r--r-- | cli/tests/testdata/test/unresolved_promise.out | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/cli/tests/testdata/test/unresolved_promise.out b/cli/tests/testdata/test/unresolved_promise.out index 92eb16bed..88535e171 100644 --- a/cli/tests/testdata/test/unresolved_promise.out +++ b/cli/tests/testdata/test/unresolved_promise.out @@ -1,5 +1,10 @@ -Check [WILDCARD]/test/unresolved_promise.ts - -ok | 0 passed | 0 failed ([WILDCARD]) - -error: Module evaluation is still pending but there are no pending ops or dynamic imports. This situation is often caused by unresolved promises. +[WILDCARD] +./test/unresolved_promise.ts (uncaught error) +error: Top-level await promise never resolved +await new Promise((_resolve, _reject) => {}); +^ + at <anonymous> ([WILDCARD]/test/unresolved_promise.ts:1:1) +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. +[WILDCARD] +error: Test failed |
