mirror of
https://github.com/nodejs/node.git
synced 2025-05-12 09:36:17 +00:00

PR-URL: https://github.com/nodejs/node/pull/11143 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: James M Snell <jasnell@gmail.com>
19 lines
447 B
JavaScript
19 lines
447 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
|
|
if (!common.hasCrypto) {
|
|
common.skip('missing crypto');
|
|
return;
|
|
}
|
|
|
|
const assert = require('assert');
|
|
const crypto = require('crypto');
|
|
|
|
assert.throws(function() {
|
|
crypto.setEngine(true);
|
|
}, /^TypeError: "id" argument should be a string$/);
|
|
|
|
assert.throws(function() {
|
|
crypto.setEngine('/path/to/engine', 'notANumber');
|
|
}, /^TypeError: "flags" argument should be a number, if present$/);
|