test: add regex for expected error message

Provide a regex to validate the error message.

PR-URL: https://github.com/nodejs/node/pull/12011
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
This commit is contained in:
John F. Mercer authored and Franziska Hinkelmann committed 2017-03-26 11:39:08 +02:00
1 parent 1377d5ac2e
commit c13dda1c43
1 file changed
+3 -1
+3 -1
View File
@@ -29,6 +29,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'),
@@ -37,4 +39,4 @@ const options = {
assert.throws(function() {
tls.createSecureContext(options);
});
}, errorMessageRegex);