diff options
author | 2023-01-01 12:04:49 -0800 | |
---|---|---|
committer | 2023-01-01 12:04:49 -0800 | |
commit | 96438a4d58569abedccdfe6acff0ad6ed60bb5bc (patch) | |
tree | be97cd6fa6bdf0d135be0467f8919a60821ddb90 /test/bun.js | |
parent | 5b3cf8bec56e7c13d2cce557bab8e203be729006 (diff) | |
download | bun-96438a4d58569abedccdfe6acff0ad6ed60bb5bc.tar.gz bun-96438a4d58569abedccdfe6acff0ad6ed60bb5bc.tar.zst bun-96438a4d58569abedccdfe6acff0ad6ed60bb5bc.zip |
test crypto.randomBytes returns a Buffer
Diffstat (limited to 'test/bun.js')
-rw-r--r-- | test/bun.js/node-crypto.test.js | 8 |
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); +}); |