diff options
author | Jason <m.jason.liu@outlook.com> | 2022-03-20 19:21:42 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-20 20:21:42 +0900 |
commit | 0bc286ab47d82496b90efb429e16efccc10e5f2d (patch) | |
tree | f755dc9422e1153a06548e63e31c1279f0b484ee /cli/tests/unit/console_test.ts | |
parent | 5e82bcf0e422d657591328a0d6645b16ea45959c (diff) |
fix(ext/console): fix error with a Proxy of a Map (#14032)
Diffstat (limited to 'cli/tests/unit/console_test.ts')
-rw-r--r-- | cli/tests/unit/console_test.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/cli/tests/unit/console_test.ts b/cli/tests/unit/console_test.ts index 97c84b690..d1c570e1b 100644 --- a/cli/tests/unit/console_test.ts +++ b/cli/tests/unit/console_test.ts @@ -1609,6 +1609,24 @@ Deno.test(function consoleLogShoultNotThrowErrorWhenInvalidDateIsPassed() { }); }); +// console.log(new Proxy(new Set(), {})) +Deno.test(function consoleLogShouldNotThrowErrorWhenInputIsProxiedSet() { + mockConsole((console, out) => { + const proxiedSet = new Proxy(new Set(), {}); + console.log(proxiedSet); + assertEquals(stripColor(out.toString()), "Set {}\n"); + }); +}); + +// console.log(new Proxy(new Map(), {})) +Deno.test(function consoleLogShouldNotThrowErrorWhenInputIsProxiedMap() { + mockConsole((console, out) => { + const proxiedMap = new Proxy(new Map(), {}); + console.log(proxiedMap); + assertEquals(stripColor(out.toString()), "Map {}\n"); + }); +}); + // console.dir test Deno.test(function consoleDir() { mockConsole((console, out) => { |