diff --git a/test/parallel/test-buffer-alloc.js b/test/parallel/test-buffer-alloc.js index 7f910807917063..7ebe34b21edb1e 100644 --- a/test/parallel/test-buffer-alloc.js +++ b/test/parallel/test-buffer-alloc.js @@ -984,8 +984,8 @@ Buffer.poolSize = ps; assert.throws(() => Buffer.allocUnsafe(10).copy(), /TypeError: argument should be a Buffer/); -const regErrorMsg = new RegExp('First argument must be a string, Buffer, ' + - 'ArrayBuffer, Array, or array-like object.'); +const regErrorMsg = + /First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object\./; assert.throws(() => Buffer.from(), regErrorMsg); assert.throws(() => Buffer.from(null), regErrorMsg); diff --git a/test/parallel/test-tls-env-bad-extra-ca.js b/test/parallel/test-tls-env-bad-extra-ca.js index 9b42bbbbd5558e..c472789659e1d2 100644 --- a/test/parallel/test-tls-env-bad-extra-ca.js +++ b/test/parallel/test-tls-env-bad-extra-ca.js @@ -33,10 +33,9 @@ fork(__filename, opts) assert.strictEqual(status, 0, 'client did not succeed in connecting'); })) .on('close', common.mustCall(function() { - assert(stderr.match(new RegExp( - 'Warning: Ignoring extra certs from.*no-such-file-exists' + - '.* load failed:.*No such file or directory' - )), stderr); + assert(stderr.match( + /Warning: Ignoring extra certs from.*no-such-file-exists.* load failed:.*No such file or directory/ + ), stderr); })) .stderr.setEncoding('utf8').on('data', function(str) { stderr += str; diff --git a/test/parallel/test-tls-key-mismatch.js b/test/parallel/test-tls-key-mismatch.js index 93c7e70d8c61f7..742282c91ed115 100644 --- a/test/parallel/test-tls-key-mismatch.js +++ b/test/parallel/test-tls-key-mismatch.js @@ -8,8 +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 errorMessageRegex = + /^Error: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch$/; const options = { key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), diff --git a/test/parallel/test-util-inherits.js b/test/parallel/test-util-inherits.js index 4ddf9ad35dd2d6..13094ef695081b 100644 --- a/test/parallel/test-util-inherits.js +++ b/test/parallel/test-util-inherits.js @@ -4,8 +4,7 @@ require('../common'); const assert = require('assert'); const inherits = require('util').inherits; const errCheck = - new RegExp('^TypeError: The super constructor to "inherits" must not be ' + - 'null or undefined$'); + /^TypeError: The super constructor to "inherits" must not be null or undefined$/; // super constructor