Skip to content

Commit c13dda1

Browse files
jfmercerfhinkel
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 1377d5a commit c13dda1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ if (!common.hasCrypto) {
2929
const assert = require('assert');
3030
const tls = require('tls');
3131
const fs = require('fs');
32+
const errorMessageRegex = new RegExp('^Error: error:0B080074:x509 ' +
33+
'certificate routines:X509_check_private_key:key values mismatch$');
3234

3335
const options = {
3436
key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'),
@@ -37,4 +39,4 @@ const options = {
3739

3840
assert.throws(function() {
3941
tls.createSecureContext(options);
40-
});
42+
}, errorMessageRegex);

0 commit comments

Comments
 (0)