aboutsummaryrefslogtreecommitdiff
path: root/test/bun.js/node-crypto.test.js
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-01-01 12:04:49 -0800
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-01-01 12:04:49 -0800
commit96438a4d58569abedccdfe6acff0ad6ed60bb5bc (patch)
treebe97cd6fa6bdf0d135be0467f8919a60821ddb90 /test/bun.js/node-crypto.test.js
parent5b3cf8bec56e7c13d2cce557bab8e203be729006 (diff)
downloadbun-96438a4d58569abedccdfe6acff0ad6ed60bb5bc.tar.gz
bun-96438a4d58569abedccdfe6acff0ad6ed60bb5bc.tar.zst
bun-96438a4d58569abedccdfe6acff0ad6ed60bb5bc.zip
test crypto.randomBytes returns a Buffer
Diffstat (limited to 'test/bun.js/node-crypto.test.js')
-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);
+});