Browse Source

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>
v6.x
Sebastian Van Sande 8 years ago
committed by Myles Borins
parent
commit
3248cdb2e6
No known key found for this signature in database GPG Key ID: 933B01F40B5CA946
  1. 18
      test/parallel/test-crypto-engine.js

18
test/parallel/test-crypto-engine.js

@ -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$/);
Loading…
Cancel
Save