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 <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
  • Loading branch information
rxiayth authored and MylesBorins committed Nov 29, 2018
1 parent a8501e4 commit 5292f54
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/parallel/test-crypto-keygen.js
Original file line number Diff line number Diff line change
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 5292f54

Please sign in to comment.