diff options
author | Sebastian Van Sande <sebastian@vansande.org> | 2017-02-03 10:18:59 +0100 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2017-02-07 15:45:52 -0800 |
commit | ddbfdba4da651c386fc90894a2f327940acf2bdd (patch) | |
tree | 421c3c8e7c7115b7aaa981bb78770c89cd247a56 /test/parallel/test-crypto-engine.js | |
parent | ef977cf8a0a538fe4804f032233a2174a8767ceb (diff) | |
download | android-node-v8-ddbfdba4da651c386fc90894a2f327940acf2bdd.tar.gz android-node-v8-ddbfdba4da651c386fc90894a2f327940acf2bdd.tar.bz2 android-node-v8-ddbfdba4da651c386fc90894a2f327940acf2bdd.zip |
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>
Diffstat (limited to 'test/parallel/test-crypto-engine.js')
-rw-r--r-- | test/parallel/test-crypto-engine.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/parallel/test-crypto-engine.js b/test/parallel/test-crypto-engine.js new file mode 100644 index 0000000000..8452087cc5 --- /dev/null +++ b/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$/); |