Skip to content

Commit

Permalink
test: added test for generateKeyPair
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
rxiayth authored and addaleax committed Oct 20, 2018
1 parent b99cde1 commit b5303cd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/parallel/test-crypto-keygen.js
Expand Up @@ -358,6 +358,16 @@ function convertDERToPEM(label, der) {
});
}

{
// Test keygen without options object.
common.expectsError(() => generateKeyPair('rsa', common.mustNotCall()), {
type: TypeError,
code: 'ERR_INVALID_ARG_TYPE',
message: 'The "options" argument must be of ' +
'type object. Received type undefined'
});
}

{
// Missing / invalid publicKeyEncoding.
for (const enc of [undefined, null, 0, 'a', true]) {
Expand Down

0 comments on commit b5303cd

Please sign in to comment.