summaryrefslogtreecommitdiff
path: root/tests/unit
diff options
context:
space:
mode:
authorMarvin Hagemeister <marvin@deno.com>2024-10-08 12:10:19 +0200
committerGitHub <noreply@github.com>2024-10-08 12:10:19 +0200
commit2d488e4bfb9ffdfd2d043cc4bba9e6037b4cc24e (patch)
treed71f96e94469ca3478e5a062c7240dc1986fc155 /tests/unit
parent053894b9e0899757f156b8cd956fd467e0e11a63 (diff)
fix(console): missing cause property on non-error objects (#26061)
Fixes https://github.com/denoland/deno/issues/26047
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/console_test.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/unit/console_test.ts b/tests/unit/console_test.ts
index 201d18f00..878d17ae3 100644
--- a/tests/unit/console_test.ts
+++ b/tests/unit/console_test.ts
@@ -1913,6 +1913,21 @@ Deno.test(function consoleLogWhenCauseIsAssignedShouldNotPrintCauseTwice() {
});
});
+Deno.test(function consoleLogCauseNotFilteredOnNonError() {
+ mockConsole((console, out) => {
+ const foo = {
+ a: 1,
+ b: 2,
+ cause: 3,
+ };
+ console.log(foo);
+
+ const result = stripAnsiCode(out.toString());
+ const expected = "{ a: 1, b: 2, cause: 3 }\n";
+ assertEquals(result.trim(), expected.trim());
+ });
+});
+
// console.log(new Proxy(new RegExp(), {}))
Deno.test(function consoleLogShouldNotThrowErrorWhenInputIsProxiedRegExp() {
mockConsole((console, out) => {