Permalink
Browse files

test: improve crypto.setEngine coverage to check for errors

PR-URL: #11143
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information...
seppevs authored and italoacasas committed Feb 3, 2017
1 parent 71f8a23 commit 9c729211e4d240336a735af68f13f8f5ffd23e61
Showing with 18 additions and 0 deletions.
  1. +18 −0 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$/);

0 comments on commit 9c72921

Please sign in to comment.