Skip to content

Commit 1c0435b

Browse files
jfmercerMylesBorins
authored andcommitted
test: add regex for expected error message
Provide a regex to validate the error message. PR-URL: #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]>
1 parent a73dea9 commit 1c0435b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/parallel/test-tls-key-mismatch.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ if (!common.hasCrypto) {
88
const assert = require('assert');
99
const tls = require('tls');
1010
const fs = require('fs');
11+
const errorMessageRegex = new RegExp('^Error: error:0B080074:x509 ' +
12+
'certificate routines:X509_check_private_key:key values mismatch$');
1113

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

1719
assert.throws(function() {
1820
tls.createSecureContext(options);
19-
});
21+
}, errorMessageRegex);

0 commit comments

Comments
 (0)