Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: added test for generateKeyPair
  • Loading branch information
rxiayth committed Oct 12, 2018
commit 01ef76a5ad062d421053879948003a9d07f0f4c8
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