From 96438a4d58569abedccdfe6acff0ad6ed60bb5bc Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Sun, 1 Jan 2023 12:04:49 -0800 Subject: test crypto.randomBytes returns a Buffer --- test/bun.js/node-crypto.test.js | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 test/bun.js/node-crypto.test.js (limited to 'test/bun.js/node-crypto.test.js') diff --git a/test/bun.js/node-crypto.test.js b/test/bun.js/node-crypto.test.js new file mode 100644 index 000000000..edd6f6e3d --- /dev/null +++ b/test/bun.js/node-crypto.test.js @@ -0,0 +1,8 @@ +import { it, expect } from "bun:test"; + +const nodeCrypto = require("node:crypto"); + +it("crypto.randomBytes should return a Buffer", () => { + expect(nodeCrypto.randomBytes(1) instanceof Buffer).toBe(true); + expect(Buffer.isBuffer(nodeCrypto.randomBytes(1))).toBe(true); +}); -- cgit v1.2.3