From e5500f823d7a6055ffcd6b7403b1d2120b4a8a0a Mon Sep 17 00:00:00 2001 From: David Xue Date: Fri, 12 Oct 2018 10:42:25 -0700 Subject: [PATCH] test: added test for generateKeyPair MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/23541 Reviewed-By: James M Snell Reviewed-By: Tobias Nießen Reviewed-By: Colin Ihrig Reviewed-By: Trivikram Kamat Reviewed-By: Ruben Bridgewater --- test/parallel/test-crypto-keygen.js | 10 ++++++++++ 1 file changed, 10 insertions(+) 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]) {