diff --git a/test/parallel/test-crypto-keygen.js b/test/parallel/test-crypto-keygen.js index af60c662f9340d..e9fe630dd72e84 100644 --- a/test/parallel/test-crypto-keygen.js +++ b/test/parallel/test-crypto-keygen.js @@ -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]) {