Skip to content

Commit 0afcea2

Browse files
LekoMylesBorins
authored andcommitted
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: #17418 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Jon Moss <[email protected]>
1 parent c9a4f4f commit 0afcea2

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/parallel/test-crypto-engine.js

+17
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ if (!common.hasCrypto)
55
common.skip('missing crypto');
66

77
const crypto = require('crypto');
8+
const invalidEngineName = 'xxx';
89

910
common.expectsError(
1011
() => crypto.setEngine(true),
@@ -21,3 +22,19 @@ common.expectsError(
2122
type: TypeError,
2223
message: 'The "flags" argument must be of type number'
2324
});
25+
26+
common.expectsError(
27+
() => crypto.setEngine(invalidEngineName),
28+
{
29+
code: 'ERR_CRYPTO_ENGINE_UNKNOWN',
30+
type: Error,
31+
message: `Engine "${invalidEngineName}" was not found`
32+
});
33+
34+
common.expectsError(
35+
() => crypto.setEngine(invalidEngineName, crypto.constants.ENGINE_METHOD_RSA),
36+
{
37+
code: 'ERR_CRYPTO_ENGINE_UNKNOWN',
38+
type: Error,
39+
message: `Engine "${invalidEngineName}" was not found`
40+
});

0 commit comments

Comments
 (0)