diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2021-07-08 09:43:36 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-08 09:43:36 -0400 |
commit | 5fa58c92165e23386b8ed3c3079103997fe1bef9 (patch) | |
tree | d7efc34a11322d10f2749b5083cd84fa1b4a18d6 /cli/tests/unit/dom_exception_test.ts | |
parent | 5e092b19fe113bdecd36b4e0184c82f4b3343bca (diff) |
fix: inspecting prototypes of built-ins with custom inspect implementations should not throw (#11308)
Diffstat (limited to 'cli/tests/unit/dom_exception_test.ts')
-rw-r--r-- | cli/tests/unit/dom_exception_test.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cli/tests/unit/dom_exception_test.ts b/cli/tests/unit/dom_exception_test.ts new file mode 100644 index 000000000..ea310fc9a --- /dev/null +++ b/cli/tests/unit/dom_exception_test.ts @@ -0,0 +1,10 @@ +import { assertEquals, assertStringIncludes, unitTest } from "./test_util.ts"; + +unitTest(function customInspectFunction(): void { + const blob = new DOMException("test"); + assertEquals( + Deno.inspect(blob), + `DOMException: test`, + ); + assertStringIncludes(Deno.inspect(DOMException.prototype), "DOMException"); +}); |