Skip to content

Commit

Permalink
test: add regex for expected error message
Browse files Browse the repository at this point in the history
Provide a regex to validate the error message.

PR-URL: nodejs/node#12011
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Yuta Hiroto <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Franziska Hinkelmann <[email protected]>
  • Loading branch information
jfmercer authored and andrew749 committed Jul 19, 2017
1 parent 9c7840a commit 58e4b60
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/parallel/test-tls-key-mismatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ if (!common.hasCrypto) {
const assert = require('assert');
const tls = require('tls');
const fs = require('fs');
const errorMessageRegex = new RegExp('^Error: error:0B080074:x509 ' +
'certificate routines:X509_check_private_key:key values mismatch$');

const options = {
key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'),
Expand All @@ -16,4 +18,4 @@ const options = {

assert.throws(function() {
tls.createSecureContext(options);
});
}, errorMessageRegex);

0 comments on commit 58e4b60

Please sign in to comment.