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/blob_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/blob_test.ts')
-rw-r--r-- | cli/tests/unit/blob_test.ts | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/cli/tests/unit/blob_test.ts b/cli/tests/unit/blob_test.ts index f9e506334..ebb91658a 100644 --- a/cli/tests/unit/blob_test.ts +++ b/cli/tests/unit/blob_test.ts @@ -1,5 +1,10 @@ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. -import { assert, assertEquals, unitTest } from "./test_util.ts"; +import { + assert, + assertEquals, + assertStringIncludes, + unitTest, +} from "./test_util.ts"; import { concat } from "../../../test_util/std/bytes/mod.ts"; unitTest(function blobString(): void { @@ -104,3 +109,12 @@ unitTest(function blobConstructorNameIsBlob(): void { const blob = new Blob(); assertEquals(blob.constructor.name, "Blob"); }); + +unitTest(function blobCustomInspectFunction(): void { + const blob = new Blob(); + assertEquals( + Deno.inspect(blob), + `Blob { size: 0, type: "" }`, + ); + assertStringIncludes(Deno.inspect(Blob.prototype), "Blob"); +}); |