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$/);