test: added test for generateKeyPair
PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
parent
d83d3ed2bc
commit
446771eb65
@ -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.
|
// Missing / invalid publicKeyEncoding.
|
||||||
for (const enc of [undefined, null, 0, 'a', true]) {
|
for (const enc of [undefined, null, 0, 'a', true]) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user