mirror of
https://github.com/nodejs/node.git
synced 2025-05-01 08:42:45 +00:00

Split test-crypto-dh.js so that it is less likely to timeout on less powerful bots. PR-URL: https://github.com/nodejs/node/pull/40451 Refs: https://github.com/nodejs/reliability/issues/86 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
27 lines
790 B
JavaScript
27 lines
790 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
if (!common.hasCrypto)
|
|
common.skip('missing crypto');
|
|
|
|
const assert = require('assert');
|
|
const crypto = require('crypto');
|
|
|
|
assert.throws(
|
|
function() {
|
|
crypto.getDiffieHellman('modp1').setPrivateKey('');
|
|
},
|
|
new RegExp('^TypeError: crypto\\.getDiffieHellman\\(\\.\\.\\.\\)\\.' +
|
|
'setPrivateKey is not a function$'),
|
|
'crypto.getDiffieHellman(\'modp1\').setPrivateKey(\'\') ' +
|
|
'failed to throw the expected error.'
|
|
);
|
|
assert.throws(
|
|
function() {
|
|
crypto.getDiffieHellman('modp1').setPublicKey('');
|
|
},
|
|
new RegExp('^TypeError: crypto\\.getDiffieHellman\\(\\.\\.\\.\\)\\.' +
|
|
'setPublicKey is not a function$'),
|
|
'crypto.getDiffieHellman(\'modp1\').setPublicKey(\'\') ' +
|
|
'failed to throw the expected error.'
|
|
);
|