diff --git a/test/parallel/test-buffer-bigint64.js b/test/parallel/test-buffer-bigint64.js index 60d376bdaf84af..a160d35b4a551a 100644 --- a/test/parallel/test-buffer-bigint64.js +++ b/test/parallel/test-buffer-bigint64.js @@ -7,49 +7,49 @@ const buf = Buffer.allocUnsafe(8); ['LE', 'BE'].forEach(function(endianness) { // Should allow simple BigInts to be written and read let val = 123456789n; - buf['writeBigInt64' + endianness](val, 0); - let rtn = buf['readBigInt64' + endianness](0); + buf[`writeBigInt64${endianness}`](val, 0); + let rtn = buf[`readBigInt64${endianness}`](0); assert.strictEqual(val, rtn); // Should allow INT64_MAX to be written and read val = 0x7fffffffffffffffn; - buf['writeBigInt64' + endianness](val, 0); - rtn = buf['readBigInt64' + endianness](0); + buf[`writeBigInt64${endianness}`](val, 0); + rtn = buf[`readBigInt64${endianness}`](0); assert.strictEqual(val, rtn); // Should read and write a negative signed 64-bit integer val = -123456789n; - buf['writeBigInt64' + endianness](val, 0); - assert.strictEqual(val, buf['readBigInt64' + endianness](0)); + buf[`writeBigInt64${endianness}`](val, 0); + assert.strictEqual(val, buf[`readBigInt64${endianness}`](0)); // Should read and write an unsigned 64-bit integer val = 123456789n; - buf['writeBigUInt64' + endianness](val, 0); - assert.strictEqual(val, buf['readBigUInt64' + endianness](0)); + buf[`writeBigUInt64${endianness}`](val, 0); + assert.strictEqual(val, buf[`readBigUInt64${endianness}`](0)); // Should throw a RangeError upon INT64_MAX+1 being written assert.throws(function() { const val = 0x8000000000000000n; - buf['writeBigInt64' + endianness](val, 0); + buf[`writeBigInt64${endianness}`](val, 0); }, RangeError); // Should throw a RangeError upon UINT64_MAX+1 being written assert.throws(function() { const val = 0x10000000000000000n; - buf['writeBigUInt64' + endianness](val, 0); + buf[`writeBigUInt64${endianness}`](val, 0); }, { code: 'ERR_OUT_OF_RANGE', message: 'The value of "value" is out of range. It must be ' + - '>= 0n and < 2n ** 64n. Received 18_446_744_073_709_551_616n' + '>= 0n and < 2n ** 64n. Received 18_446_744_073_709_551_616n' }); // Should throw a TypeError upon invalid input assert.throws(function() { - buf['writeBigInt64' + endianness]('bad', 0); + buf[`writeBigInt64${endianness}`]('bad', 0); }, TypeError); // Should throw a TypeError upon invalid input assert.throws(function() { - buf['writeBigUInt64' + endianness]('bad', 0); + buf[`writeBigUInt64${endianness}`]('bad', 0); }, TypeError); }); diff --git a/test/parallel/test-http-readable-data-event.js b/test/parallel/test-http-readable-data-event.js index 21b1fa65c661c8..643176ec7b066a 100644 --- a/test/parallel/test-http-readable-data-event.js +++ b/test/parallel/test-http-readable-data-event.js @@ -10,14 +10,14 @@ let next = null; const server = http.createServer((req, res) => { res.writeHead(200, { - 'Content-Length': '' + (helloWorld.length + helloAgainLater.length) + 'Content-Length': `${(helloWorld.length + helloAgainLater.length)}` }); // We need to make sure the data is flushed // before writing again next = () => { res.end(helloAgainLater); - next = () => {}; + next = () => { }; }; res.write(helloWorld); diff --git a/test/parallel/test-http2-origin.js b/test/parallel/test-http2-origin.js index 6f90a043d8a7cc..519e8cb1a3dedd 100644 --- a/test/parallel/test-http2-origin.js +++ b/test/parallel/test-http2-origin.js @@ -70,7 +70,7 @@ const ca = readKey('fake-startcom-root-cert.pem', 'binary'); } ); }); - const longInput = 'http://foo.bar' + 'a'.repeat(16383); + const longInput = `http://foo.bar${'a'.repeat(16383)}`; throws( () => session.origin(longInput), { @@ -107,7 +107,7 @@ const ca = readKey('fake-startcom-root-cert.pem', 'binary'); // Test automatically sending origin on connection start { - const origins = [ 'https://foo.org/a/b/c', 'https://bar.org' ]; + const origins = ['https://foo.org/a/b/c', 'https://bar.org']; const server = createSecureServer({ key, cert, origins }); server.on('stream', mustCall((stream) => { stream.respond(); diff --git a/test/parallel/test-http2-server-session-destroy.js b/test/parallel/test-http2-server-session-destroy.js index 9b7f126510757c..afa3dd3398dba8 100644 --- a/test/parallel/test-http2-server-session-destroy.js +++ b/test/parallel/test-http2-server-session-destroy.js @@ -16,5 +16,5 @@ server.listen(0, common.localhostIPv4, common.mustCall(() => { const port = server.address().port; const host = common.localhostIPv4; - h2.connect('http://' + host + ':' + port, afterConnect); + h2.connect(`http://${host}:${port}`, afterConnect); })); diff --git a/test/parallel/test-promises-warning-on-unhandled-rejection.js b/test/parallel/test-promises-warning-on-unhandled-rejection.js index ba420157e72bbd..596bf27ad1917d 100644 --- a/test/parallel/test-promises-warning-on-unhandled-rejection.js +++ b/test/parallel/test-promises-warning-on-unhandled-rejection.js @@ -23,7 +23,7 @@ process.on('warning', common.mustCall((warning) => { assert( /Unhandled promise rejection/.test(warning.message), 'Expected warning message to contain "Unhandled promise rejection" ' + - 'but did not. Had "' + warning.message + '" instead.' + `but did not. Had "${warning.message}" instead.` ); break; case 2: @@ -40,7 +40,7 @@ process.on('warning', common.mustCall((warning) => { assert( /Unhandled promise rejection/.test(warning.message), 'Expected warning message to contain "Unhandled promise rejection" ' + - 'but did not. Had "' + warning.message + '" instead.' + `but did not. Had "${warning.message}" instead.` ); break; case 5: diff --git a/test/parallel/test-tls-psk-server.js b/test/parallel/test-tls-psk-server.js index 69b850c70226a6..434d31380fe2ad 100644 --- a/test/parallel/test-tls-psk-server.js +++ b/test/parallel/test-tls-psk-server.js @@ -43,7 +43,7 @@ let gotWorld = false; server.listen(0, () => { const client = spawn(common.opensslCli, [ 's_client', - '-connect', '127.0.0.1:' + server.address().port, + '-connect', `127.0.0.1:${server.address().port}`, '-cipher', CIPHERS, '-psk', KEY, '-psk_identity', IDENTITY diff --git a/test/parallel/test-worker-relative-path.js b/test/parallel/test-worker-relative-path.js index 3b7bb95b0d78f4..73dc5b3637912f 100644 --- a/test/parallel/test-worker-relative-path.js +++ b/test/parallel/test-worker-relative-path.js @@ -5,7 +5,7 @@ const assert = require('assert'); const { Worker, isMainThread, parentPort } = require('worker_threads'); if (isMainThread) { - const w = new Worker('./' + path.relative('.', __filename)); + const w = new Worker(`./${path.relative('.', __filename)}`); w.on('message', common.mustCall((message) => { assert.strictEqual(message, 'Hello, world!'); }));