summaryrefslogtreecommitdiff
path: root/cli/tests/integration/repl_tests.rs
diff options
context:
space:
mode:
authorCasper Beyer <caspervonb@pm.me>2021-07-07 05:33:06 +0800
committerGitHub <noreply@github.com>2021-07-06 23:33:06 +0200
commit78ac19f51f48984ea16f97a0c574fa507544b8d5 (patch)
tree141f8665d88f1c8f2a80af3280e620217d9d82e2 /cli/tests/integration/repl_tests.rs
parent7edb1d713c036583e2ba3caf0df042835781a49c (diff)
fix(repl): do not panic when Deno.inspect throws (#11292)
Diffstat (limited to 'cli/tests/integration/repl_tests.rs')
-rw-r--r--cli/tests/integration/repl_tests.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/cli/tests/integration/repl_tests.rs b/cli/tests/integration/repl_tests.rs
index 00be42ac3..43ab32232 100644
--- a/cli/tests/integration/repl_tests.rs
+++ b/cli/tests/integration/repl_tests.rs
@@ -611,3 +611,24 @@ fn assign_underscore_error() {
));
assert!(err.is_empty());
}
+
+#[test]
+fn custom_inspect() {
+ let (out, err) = util::run_and_collect_output(
+ true,
+ "repl",
+ Some(vec![
+ r#"const o = {
+ [Symbol.for("Deno.customInspect")]() {
+ throw new Error('Oops custom inspect error');
+ },
+ };"#,
+ "o",
+ ]),
+ Some(vec![("NO_COLOR".to_owned(), "1".to_owned())]),
+ false,
+ );
+
+ assert!(out.contains("Oops custom inspect error"));
+ assert!(err.is_empty());
+}