summaryrefslogtreecommitdiff
path: root/cli/tests/unit/console_test.ts
diff options
context:
space:
mode:
authorNayeem Rahman <nayeemrmn99@gmail.com>2020-10-01 10:25:34 +0100
committerGitHub <noreply@github.com>2020-10-01 11:25:34 +0200
commitb689e60b602be547c701094ba76fe3a545cad70d (patch)
treec7ddde2efe7bbfeb22b377c52c1b381efaf70ac6 /cli/tests/unit/console_test.ts
parent290da280a8a8ab8f886462cd61484f5a6a4d57a4 (diff)
fix(cli/console): Catch and format getter errors (#7766)
Diffstat (limited to 'cli/tests/unit/console_test.ts')
-rw-r--r--cli/tests/unit/console_test.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/cli/tests/unit/console_test.ts b/cli/tests/unit/console_test.ts
index 514b29cc2..c9cbcc313 100644
--- a/cli/tests/unit/console_test.ts
+++ b/cli/tests/unit/console_test.ts
@@ -1498,6 +1498,17 @@ unitTest(function inspectString(): void {
);
});
+unitTest(function inspectGetterError(): void {
+ assertEquals(
+ Deno.inspect({
+ get foo() {
+ throw new Error("bar");
+ },
+ }),
+ "{ foo: [Thrown Error: bar] }",
+ );
+});
+
unitTest(function inspectSorted(): void {
assertEquals(
stripColor(Deno.inspect({ b: 2, a: 1 }, { sorted: true })),