diff options
author | 2023-01-17 13:44:13 -0800 | |
---|---|---|
committer | 2023-01-17 13:44:13 -0800 | |
commit | 69875d86cd24b9fd0368c61ed038f96207919a39 (patch) | |
tree | ca9fc6c5810158b0d7bed25872cc961a693c572c /test/bun.js/inspect.test.js | |
parent | 5bdc923838da0ccacd30c092b00446f4f503a26f (diff) | |
download | bun-69875d86cd24b9fd0368c61ed038f96207919a39.tar.gz bun-69875d86cd24b9fd0368c61ed038f96207919a39.tar.zst bun-69875d86cd24b9fd0368c61ed038f96207919a39.zip |
Fix console.log printing multiple properties
Diffstat (limited to 'test/bun.js/inspect.test.js')
-rw-r--r-- | test/bun.js/inspect.test.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/bun.js/inspect.test.js b/test/bun.js/inspect.test.js index 738442211..d0f4f026a 100644 --- a/test/bun.js/inspect.test.js +++ b/test/bun.js/inspect.test.js @@ -1,5 +1,14 @@ import { it, expect, describe } from "bun:test"; +it("when prototype defines the same property, don't print the same property twice", () => { + var base = { + foo: "123", + }; + var obj = Object.create(base); + obj.foo = "456"; + expect(Bun.inspect(obj).trim()).toBe('{\n foo: "456"\n}'.trim()); +}); + it("Blob inspect", () => { expect(Bun.inspect(new Blob(["123"]))).toBe(`Blob (3 bytes)`); expect(Bun.inspect(new Blob(["123".repeat(900)]))).toBe(`Blob (2.70 KB)`); |