diff options
author | 2022-10-06 14:18:12 -0700 | |
---|---|---|
committer | 2022-10-06 14:18:12 -0700 | |
commit | 6970250b57918a9bc2199f40496dad59a5f622ce (patch) | |
tree | fed546b53cbfcb8baba30f49ada23297264a43d5 /test/bun.js/buffer.test.js | |
parent | c880c53199f2c59f4444362e6ae1fa210733c48f (diff) | |
download | bun-6970250b57918a9bc2199f40496dad59a5f622ce.tar.gz bun-6970250b57918a9bc2199f40496dad59a5f622ce.tar.zst bun-6970250b57918a9bc2199f40496dad59a5f622ce.zip |
Fix Buffer.toJSON()
Diffstat (limited to 'test/bun.js/buffer.test.js')
-rw-r--r-- | test/bun.js/buffer.test.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/bun.js/buffer.test.js b/test/bun.js/buffer.test.js index c3f422024..02ee1e75e 100644 --- a/test/bun.js/buffer.test.js +++ b/test/bun.js/buffer.test.js @@ -4,6 +4,15 @@ import { gc } from "./gc"; beforeEach(() => gc()); afterEach(() => gc()); +it("Buffer.toJSON()", () => { + expect(JSON.stringify(Buffer.from("hello"))).toBe( + JSON.stringify({ + type: "Buffer", + data: [104, 101, 108, 108, 111], + }) + ); +}); + it("buffer", () => { var buf = new Buffer(20); gc(); |