summaryrefslogtreecommitdiff
path: root/test/parallel/test-crypto-engine.js
blob: b2fe154d3c228f29940113e3c7e3a6436768dd27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
'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.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$/);