diff options
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/integration/repl_tests.rs | 14 | ||||
-rw-r--r-- | cli/tests/unit/console_test.ts | 11 |
2 files changed, 25 insertions, 0 deletions
diff --git a/cli/tests/integration/repl_tests.rs b/cli/tests/integration/repl_tests.rs index 07b7575a0..cdeb36c9c 100644 --- a/cli/tests/integration/repl_tests.rs +++ b/cli/tests/integration/repl_tests.rs @@ -861,3 +861,17 @@ fn repl_report_error() { assert_contains!(out, "1\n2\nundefined\n"); assert!(err.is_empty()); } + +#[test] +fn pty_aggregate_error() { + let (out, err) = util::run_and_collect_output( + true, + "repl", + Some(vec!["await Promise.any([])"]), + Some(vec![("NO_COLOR".to_owned(), "1".to_owned())]), + false, + ); + + assert_contains!(out, "AggregateError"); + assert!(err.is_empty()); +} diff --git a/cli/tests/unit/console_test.ts b/cli/tests/unit/console_test.ts index 1b364eda1..1faef6bd7 100644 --- a/cli/tests/unit/console_test.ts +++ b/cli/tests/unit/console_test.ts @@ -2027,3 +2027,14 @@ Deno.test(function inspectStringAbbreviation() { '[ "This is a ..." ]', ); }); + +Deno.test(async function inspectAggregateError() { + try { + await Promise.any([]); + } catch (err) { + assertEquals( + Deno.inspect(err).trimEnd(), + "AggregateError: All promises were rejected", + ); + } +}); |