diff options
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/deno_test_unresolved_promise.out | 4 | ||||
-rw-r--r-- | cli/tests/integration_tests.rs | 6 | ||||
-rw-r--r-- | cli/tests/test_unresolved_promise.js | 15 |
3 files changed, 25 insertions, 0 deletions
diff --git a/cli/tests/deno_test_unresolved_promise.out b/cli/tests/deno_test_unresolved_promise.out new file mode 100644 index 000000000..cc4f2985e --- /dev/null +++ b/cli/tests/deno_test_unresolved_promise.out @@ -0,0 +1,4 @@ +Check [WILDCARD] +running 2 tests +test unresolved promise ... in promise +error: Module evaluation is still pending but there are no pending ops or dynamic imports. This situation is often caused by unresolved promise. diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index 66a83a655..9dff74f25 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -1646,6 +1646,12 @@ itest!(deno_test_no_check { output: "deno_test.out", }); +itest!(deno_test_unresolved_promise { + args: "test test_unresolved_promise.js", + exit_code: 1, + output: "deno_test_unresolved_promise.out", +}); + #[test] fn timeout_clear() { // https://github.com/denoland/deno/issues/7599 diff --git a/cli/tests/test_unresolved_promise.js b/cli/tests/test_unresolved_promise.js new file mode 100644 index 000000000..466b18864 --- /dev/null +++ b/cli/tests/test_unresolved_promise.js @@ -0,0 +1,15 @@ +Deno.test({ + name: "unresolved promise", + fn() { + return new Promise((_resolve, _reject) => { + console.log("in promise"); + }); + }, +}); + +Deno.test({ + name: "ok", + fn() { + console.log("ok test"); + }, +}); |