From 54172a90f6bb4410fc10a4f0c185ee6a99583aa2 Mon Sep 17 00:00:00 2001 From: abouthiroppy Date: Fri, 13 Jan 2017 20:04:00 +0900 Subject: [PATCH] test: add crypto's setEngine test https://github.com/nodejs/node/blob/master/lib/crypto.js#L621 --- test/parallel/test-crypto-set-engine.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/parallel/test-crypto-set-engine.js diff --git a/test/parallel/test-crypto-set-engine.js b/test/parallel/test-crypto-set-engine.js new file mode 100644 index 00000000000000..e6e1c58f12f5c8 --- /dev/null +++ b/test/parallel/test-crypto-set-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(() => { + crypto.setEngine(0, 100); +}, /^TypeError: "id" argument should be a string$/); + +assert.throws(() => { + crypto.setEngine('id', '100'); +}, /^TypeError: "flags" argument should be a number, if present$/);