diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/integration/repl_tests.rs | 13 | ||||
-rw-r--r-- | tests/testdata/repl/promise_rejection.ts | 6 |
2 files changed, 19 insertions, 0 deletions
diff --git a/tests/integration/repl_tests.rs b/tests/integration/repl_tests.rs index 0e63f1589..7a09f904e 100644 --- a/tests/integration/repl_tests.rs +++ b/tests/integration/repl_tests.rs @@ -1119,3 +1119,16 @@ fn pty_promise_was_collected_regression_test() { assert_contains!(out, "Uint8Array(67108864)"); assert!(err.is_empty()); } + +#[test] +fn eval_file_promise_error() { + let (out, err) = util::run_and_collect_output_with_args( + true, + vec!["repl", "--eval-file=./repl/promise_rejection.ts"], + None, + None, + false, + ); + assert_contains!(out, "Uncaught undefined"); + assert!(err.is_empty()); +} diff --git a/tests/testdata/repl/promise_rejection.ts b/tests/testdata/repl/promise_rejection.ts new file mode 100644 index 000000000..c6c3bcbd0 --- /dev/null +++ b/tests/testdata/repl/promise_rejection.ts @@ -0,0 +1,6 @@ +// Regression test for https://github.com/denoland/deno/issues/22592 +// deno-lint-ignore require-await +async function rejects() { + return Promise.reject(); +} +await rejects(); |