0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 23:16:30 +01:00

test: improve crypto.setEngine coverage to check for errors

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>
This commit is contained in:
Sebastian Van Sande 2017-02-03 10:18:59 +01:00 committed by James M Snell
parent ef977cf8a0
commit ddbfdba4da

View File

@ -0,0 +1,18 @@
'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$/);