Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
test: Add test case for missing branch
- The case of id is string, flags is number
- The case of flags is not 0
  • Loading branch information
Leko committed Dec 1, 2017
commit 8dade49cd4f6c8215bf17b8bba3061155deaae0c
18 changes: 18 additions & 0 deletions test/parallel/test-crypto-engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ if (!common.hasCrypto)
common.skip('missing crypto');

const crypto = require('crypto');
const notExistsEngineName = 'xxx';

common.expectsError(
() => crypto.setEngine(true),
Expand All @@ -21,3 +22,20 @@ common.expectsError(
type: TypeError,
message: 'The "flags" argument must be of type number'
});

common.expectsError(
() => crypto.setEngine(notExistsEngineName),
{
code: 'ERR_CRYPTO_ENGINE_UNKNOWN',
type: Error,
message: `Engine "${notExistsEngineName}" was not found`
});

common.expectsError(
() => crypto.setEngine(notExistsEngineName,
crypto.constants.ENGINE_METHOD_RSA),
{
code: 'ERR_CRYPTO_ENGINE_UNKNOWN',
type: Error,
message: `Engine "${notExistsEngineName}" was not found`
});