summaryrefslogtreecommitdiff
path: root/tests/unit/console_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/console_test.ts')
-rw-r--r--tests/unit/console_test.ts16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/unit/console_test.ts b/tests/unit/console_test.ts
index 49960f663..4c9378bd4 100644
--- a/tests/unit/console_test.ts
+++ b/tests/unit/console_test.ts
@@ -2206,6 +2206,22 @@ Deno.test(function inspectErrorCircular() {
);
});
+Deno.test(function inspectErrorWithCauseFormat() {
+ const error = new Error("This is an error", {
+ cause: {
+ code: 100500,
+ },
+ });
+ assertStringIncludes(
+ stripColor(Deno.inspect(error)),
+ "Error: This is an error",
+ );
+ assertStringIncludes(
+ stripColor(Deno.inspect(error)),
+ "Caused by { code: 100500 }",
+ );
+});
+
Deno.test(function inspectColors() {
assertEquals(Deno.inspect(1), "1");
assertStringIncludes(Deno.inspect(1, { colors: true }), "\x1b[");