Skip to content

Commit 44b569c

Browse files
rxiaythjasnell
authored andcommitted
test: added test for generateKeyPair
PR-URL: #23541 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent ea90776 commit 44b569c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/parallel/test-crypto-keygen.js

+10
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,16 @@ function convertDERToPEM(label, der) {
358358
});
359359
}
360360

361+
{
362+
// Test keygen without options object.
363+
common.expectsError(() => generateKeyPair('rsa', common.mustNotCall()), {
364+
type: TypeError,
365+
code: 'ERR_INVALID_ARG_TYPE',
366+
message: 'The "options" argument must be of ' +
367+
'type object. Received type undefined'
368+
});
369+
}
370+
361371
{
362372
// Missing / invalid publicKeyEncoding.
363373
for (const enc of [undefined, null, 0, 'a', true]) {

0 commit comments

Comments
 (0)