diff --git a/test/parallel/test-webcrypto-random.js b/test/parallel/test-webcrypto-random.js index 31d4884d1f653f1..03d7560352b64f3 100644 --- a/test/parallel/test-webcrypto-random.js +++ b/test/parallel/test-webcrypto-random.js @@ -69,3 +69,11 @@ for (const ctor of intTypedConstructors) { ); } } + +{ + const uint8Array = new Uint8Array(32); + let results = globalThis.crypto.getRandomValues(uint8Array); + assert.strictEqual(results.length, uint8Array.length); + results = globalThis.crypto.getRandomValues(new Uint8Array()); + assert.strictEqual(results.length, 0); +}