diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2022-09-02 11:43:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-02 12:43:39 +0200 |
commit | a74b2ecf379ddb1ff03c61d4e876153d7b4c45d2 (patch) | |
tree | 47b3fbe18ba35d59b4fb1062a53544f98656138a /cli | |
parent | 658d2cdff22646010915dc1f4a128de6c42a9f79 (diff) |
fix(repl): don't terminate on unhandled error events (#15548)
Diffstat (limited to 'cli')
-rw-r--r-- | cli/tests/integration/repl_tests.rs | 17 |
1 files changed, 17 insertions, 0 deletions
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()); +} |