aboutsummaryrefslogtreecommitdiff
path: root/test/js/node/buffer.test.js
diff options
context:
space:
mode:
authorGravatar dave caruso <me@paperdave.net> 2023-09-18 20:33:58 -0400
committerGravatar GitHub <noreply@github.com> 2023-09-18 17:33:58 -0700
commiteb1dc7eede31b12726ae320263850fefaaf490f3 (patch)
tree68a1a29b2505dc01fc65d94b0eecd40a06186778 /test/js/node/buffer.test.js
parent79dd196edd820db5212da1a524fd5f888b38a3aa (diff)
downloadbun-eb1dc7eede31b12726ae320263850fefaaf490f3.tar.gz
bun-eb1dc7eede31b12726ae320263850fefaaf490f3.tar.zst
bun-eb1dc7eede31b12726ae320263850fefaaf490f3.zip
fix(runtime/node): Allow `new Buffer.alloc()` + Upgrade WebKit (#5699)
* make bufferconstructor a static hash table * chore: Upgrade WebKit to 4d995edbc44062b251be638818edcd88d7d14dd7 * make it constructable now * fix comment * yippee * update CI workflows
Diffstat (limited to 'test/js/node/buffer.test.js')
-rw-r--r--test/js/node/buffer.test.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/js/node/buffer.test.js b/test/js/node/buffer.test.js
index afc9cdee8..0256934ce 100644
--- a/test/js/node/buffer.test.js
+++ b/test/js/node/buffer.test.js
@@ -2585,3 +2585,14 @@ it("construct buffer from hex, issue #4919", () => {
expect(buf1).toStrictEqual(Buffer.from([]));
expect(buf2).toStrictEqual(Buffer.from([0x63, 0xe9, 0xf6, 0xc4, 0xb0, 0x4f, 0xa8, 0xc8, 0x0f, 0x3f, 0xb0, 0xee]));
});
+
+it("new Buffer.alloc()", () => {
+ const buf = new Buffer.alloc(10);
+ expect(buf.length).toBe(10);
+ expect(buf[0]).toBe(0);
+});
+
+it("new Buffer.from()", () => {
+ const buf = new Buffer.from("🥶");
+ expect(buf.length).toBe(4);
+});