summaryrefslogtreecommitdiff
path: root/cli/tests/unit
diff options
context:
space:
mode:
author李瑞丰 <liruifeng1024@gmail.com>2022-09-26 22:55:58 +0800
committerGitHub <noreply@github.com>2022-09-26 23:55:58 +0900
commita2262c11d750c922e6cdea1cac5ff80f603d67e9 (patch)
treefb9957327c038f55d904931bab65610b076b817d /cli/tests/unit
parentb73cb7bf9cd8825acda0d378a9afa1c3b1062f51 (diff)
fix(ext/console): fix error when logging a proxied Date (#16018)
Diffstat (limited to 'cli/tests/unit')
-rw-r--r--cli/tests/unit/console_test.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/cli/tests/unit/console_test.ts b/cli/tests/unit/console_test.ts
index 0ddbe278c..0ab2829fc 100644
--- a/cli/tests/unit/console_test.ts
+++ b/cli/tests/unit/console_test.ts
@@ -1678,6 +1678,15 @@ Deno.test(function consoleLogShouldNotThrowErrorWhenInputIsProxiedMap() {
});
});
+// console.log(new Proxy(new Date(), {}))
+Deno.test(function consoleLogShouldNotThrowErrorWhenInputIsProxiedDate() {
+ mockConsole((console, out) => {
+ const proxiedDate = new Proxy(new Date("2022-09-24T15:59:39.529Z"), {});
+ console.log(proxiedDate);
+ assertEquals(stripColor(out.toString()), "2022-09-24T15:59:39.529Z\n");
+ });
+});
+
// console.dir test
Deno.test(function consoleDir() {
mockConsole((console, out) => {