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 Myles Borins committed 2017-04-18 20:02:19 -04:00
1 parent fcc19e1637
commit c65de59f52
1 file changed
+3 -1
+3 -1
View File
@@ -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'),
@@ -16,4 +18,4 @@ const options = {
assert.throws(function() {
tls.createSecureContext(options);
});
}, errorMessageRegex);