Skip to content

Commit

Permalink
test: improve crypto.setEngine coverage to check for errors
Browse files Browse the repository at this point in the history
  • Loading branch information
seppevs committed Feb 3, 2017
1 parent dfd3046 commit a82e13d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/parallel/test-crypto-engine.js
Original file line number Diff line number Diff line change
@@ -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$/);

0 comments on commit a82e13d

Please sign in to comment.