aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/bun.js/node-crypto.test.js8
1 files changed, 8 insertions, 0 deletions
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);
+});