diff options
Diffstat (limited to 'integration/bunjs-only-snippets/buffer.test.js')
-rw-r--r-- | integration/bunjs-only-snippets/buffer.test.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/integration/bunjs-only-snippets/buffer.test.js b/integration/bunjs-only-snippets/buffer.test.js new file mode 100644 index 000000000..f8cd3aa5b --- /dev/null +++ b/integration/bunjs-only-snippets/buffer.test.js @@ -0,0 +1,12 @@ +import { describe, it, expect } from "bun:test"; + +it("buffer", () => { + var buf = new Buffer(1024); + expect(buf.write("hello world ")).toBe(12); + expect(buf.toString("utf8", 0, "hello world ".length)).toBe("hello world "); + expect(buf.toString("base64url", 0, "hello world ".length)).toBe( + btoa("hello world ") + ); + expect(buf instanceof Uint8Array).toBe(true); + expect(buf instanceof Buffer).toBe(true); +}); |