Browse Source

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>
v7.x
John F. Mercer 8 years ago
committed by Myles Borins
parent
commit
1c0435b1f3
No known key found for this signature in database GPG Key ID: 933B01F40B5CA946
  1. 4
      test/parallel/test-tls-key-mismatch.js

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

@ -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);

Loading…
Cancel
Save