mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
c75f87cc4c
* Split single monolithic file into multiple * Make Certificate methods static * Allow randomFill(Sync) to use any ArrayBufferView * Use internal/errors throughout * Improve arg validation in Hash/Hmac * Doc updates PR-URL: https://github.com/nodejs/node/pull/15231 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
24 lines
523 B
JavaScript
24 lines
523 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
|
|
if (!common.hasCrypto)
|
|
common.skip('missing crypto');
|
|
|
|
const crypto = require('crypto');
|
|
|
|
common.expectsError(
|
|
() => crypto.setEngine(true),
|
|
{
|
|
code: 'ERR_INVALID_ARG_TYPE',
|
|
type: TypeError,
|
|
message: 'The "id" argument must be of type string'
|
|
});
|
|
|
|
common.expectsError(
|
|
() => crypto.setEngine('/path/to/engine', 'notANumber'),
|
|
{
|
|
code: 'ERR_INVALID_ARG_TYPE',
|
|
type: TypeError,
|
|
message: 'The "flags" argument must be of type number'
|
|
});
|