From a74b2ecf379ddb1ff03c61d4e876153d7b4c45d2 Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Fri, 2 Sep 2022 11:43:39 +0100 Subject: fix(repl): don't terminate on unhandled error events (#15548) --- cli/tests/integration/repl_tests.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'cli') diff --git a/cli/tests/integration/repl_tests.rs b/cli/tests/integration/repl_tests.rs index 94cbef3c9..07b7575a0 100644 --- a/cli/tests/integration/repl_tests.rs +++ b/cli/tests/integration/repl_tests.rs @@ -844,3 +844,20 @@ fn pty_tab_handler() { assert_not_contains!(output, "atob"); }); } + +#[test] +fn repl_report_error() { + let (out, err) = util::run_and_collect_output( + true, + "repl", + Some(vec![ + r#"console.log(1); reportError(new Error("foo")); console.log(2);"#, + ]), + Some(vec![("NO_COLOR".to_owned(), "1".to_owned())]), + false, + ); + + // TODO(nayeemrmn): The REPL should report event errors and rejections. + assert_contains!(out, "1\n2\nundefined\n"); + assert!(err.is_empty()); +} -- cgit v1.2.3