mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
test: add test case for missing branch
- The case of id is string, flags is number - The case of flags is not 0 PR-URL: https://github.com/nodejs/node/pull/17418 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Jon Moss <me@jonathanmoss.me>
This commit is contained in:
1 parent
c9a4f4f8f1
commit
0afcea280e
1 file changed
+17
@@ -5,6 +5,7 @@ if (!common.hasCrypto)
|
||||
common.skip('missing crypto');
|
||||
|
||||
const crypto = require('crypto');
|
||||
const invalidEngineName = 'xxx';
|
||||
|
||||
common.expectsError(
|
||||
() => crypto.setEngine(true),
|
||||
@@ -21,3 +22,19 @@ common.expectsError(
|
||||
type: TypeError,
|
||||
message: 'The "flags" argument must be of type number'
|
||||
});
|
||||
|
||||
common.expectsError(
|
||||
() => crypto.setEngine(invalidEngineName),
|
||||
{
|
||||
code: 'ERR_CRYPTO_ENGINE_UNKNOWN',
|
||||
type: Error,
|
||||
message: `Engine "${invalidEngineName}" was not found`
|
||||
});
|
||||
|
||||
common.expectsError(
|
||||
() => crypto.setEngine(invalidEngineName, crypto.constants.ENGINE_METHOD_RSA),
|
||||
{
|
||||
code: 'ERR_CRYPTO_ENGINE_UNKNOWN',
|
||||
type: Error,
|
||||
message: `Engine "${invalidEngineName}" was not found`
|
||||
});
|
||||
Reference in new issue
Block a user