aboutsummaryrefslogtreecommitdiff
path: root/test/bun.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/bun.js')
-rw-r--r--test/bun.js/buffer.test.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/bun.js/buffer.test.js b/test/bun.js/buffer.test.js
index 6c4e9d721..f8704d040 100644
--- a/test/bun.js/buffer.test.js
+++ b/test/bun.js/buffer.test.js
@@ -25,6 +25,16 @@ Object.assign(assert, {
},
});
+// https://github.com/oven-sh/bun/issues/2052
+it("Buffer global is settable", () => {
+ var prevBuffer = globalThis.Buffer;
+ globalThis.Buffer = 42;
+ expect(globalThis.Buffer).toBe(42);
+ globalThis.Buffer = prevBuffer;
+ expect(globalThis.Buffer).toBe(BufferModule.Buffer);
+ expect(globalThis.Buffer).toBe(prevBuffer);
+});
+
it("Buffer.alloc", () => {
// Verify the maximum Uint8Array size. There is no concrete limit by spec. The
// internal limits should be updated if this fails.