- 'require(\'' + buildPath + '\')' + |
= |
- 'require(\'' + buildPath + '\')' + |
+ `require('${buildPath}')` + |
|
+ `require('${buildPath}')` + |
// Log output to double check callback ran. |
|
// Log output to double check callback ran. |
'.method(function() { console.log(\'cb_ran\'); });', |
|
'.method(function() { console.log(\'cb_ran\'); });', |
]; |
|
]; |
diff --git a/test/common/ |
|
diff --git a/test/common/ |
|
|
|
--- a/test/common/ |
|
--- a/test/common/ |
+++ b/test/common/ |
|
+++ b/test/common/ |
|
|
|
exports.isOSX = process.platform === 'darwin'; |
+- |
|
|
= |
|
exports.enoughTestMem = os.totalmem() > 0x40000000; /* 1 Gb */ |
+- |
|
-exports.bufferMaxSizeMsg = new RegExp('^RangeError: "size" argument' + |
|
|
- ' must not be larger than ' + |
|
|
- buffer.kMaxLength + '$'); |
|
|
+exports.bufferMaxSizeMsg = new RegExp( |
|
|
+ `^RangeError: "size" argument must not be larger than ${buffer.kMaxLength}$`); |
|
|
const cpus = os.cpus(); |
|
|
exports.enoughTestCpu = Array.isArray(cpus) && |
|
|
(cpus.length > 1 || cpus[0].speed > 999); |
|
|
|
= |
|
|
|
|
if (process.env.TEST_THREAD_ID) { |
|
if (process.env.TEST_THREAD_ID) { |
exports.PORT += process.env.TEST_THREAD_ID * 100; |
|
exports.PORT += process.env.TEST_THREAD_ID * 100; |
- exports.tmpDirName += '.' + process.env.TEST_THREAD_ID; |
|
- exports.tmpDirName += '.' + process.env.TEST_THREAD_ID; |
+ exports.tmpDirName += `.${process.env.TEST_THREAD_ID}`; |
|
+ exports.tmpDirName += `.${process.env.TEST_THREAD_ID}`; |
} |
|
} |
exports.tmpDir = path.join(testRoot, exports.tmpDirName); |
|
exports.tmpDir = path.join(testRoot, exports.tmpDirName); |
|
|
|
|
|
|
|
- return '"' + process.argv[0] + '" "' + p + '" "' + |
= |
- return '"' + process.argv[0] + '" "' + p + '" "' + |
- filename + '" ' + (kilobytes * 1024); |
|
- filename + '" ' + (kilobytes * 1024); |
+ return `"${process.argv[0]}" "${p}" "${filename}" ${kilobytes * 1024}`; |
|
+ return `"${process.argv[0]}" "${p}" "${filename}" ${kilobytes * 1024}`; |
} else { |
|
} else { |
- return 'dd if=/dev/zero of="' + filename + '" bs=1024 count=' + kilobytes; |
|
- return 'dd if=/dev/zero of="' + filename + '" bs=1024 count=' + kilobytes; |
+ return `dd if=/dev/zero of="${filename}" bs=1024 count=${kilobytes}`; |
|
+ return `dd if=/dev/zero of="${filename}" bs=1024 count=${kilobytes}`; |
} |
|
} |
}; |
|
}; |
|
|
|
|
|
|
let output = ''; |
+- |
|
|
= |
|
try { |
+- |
|
- output = execSync(whoamiPath + ' /priv', { timout: 1000 }); |
|
|
+ output = execSync(`${whoamiPath} /priv`, { timout: 1000 }); |
|
|
} catch (e) { |
|
|
err = true; |
|
|
} finally { |
|
|
|
= |
|
function ArrayStream() { |
|
function ArrayStream() { |
this.run = function(data) { |
|
this.run = function(data) { |
data.forEach((line) => { |
|
data.forEach((line) => { |
- this.emit('data', line + '\n'); |
|
- this.emit('data', line + '\n'); |
+ this.emit('data', `${line}\n`); |
|
+ this.emit('data', `${line}\n`); |
}); |
|
}); |
}; |
|
}; |
} |
|
} |
diff --git a/test/debugger/helper-debugger-repl.js b/test/debugger/helper-debugger-repl.js |
|
diff --git a/test/debugger/helper-debugger-repl.js b/test/debugger/helper-debugger-repl.js |
|
if (id === this.lastId_) { |
= |
if (id === this.lastId_) { |
this.lastMessageResponseCallback_ && this.lastMessageResponseCallback_(); |
|
this.lastMessageResponseCallback_ && this.lastMessageResponseCallback_(); |
|
|
|
}; |
|
}; |
this.sendAll_(commands, () => { |
|
this.sendAll_(commands, () => { |
timeoutId = setTimeout(() => { |
|
timeoutId = setTimeout(() => { |
- let s = ''; |
|
- let s = ''; |
- for (const id in this.messages_) { |
|
- for (const id in this.messages_) { |
- s += id + ', '; |
|
- s += id + ', '; |
- } |
|
- } |
- assert.fail('Messages without response: ' + |
<> |
- common.fail('Messages without response: ' + |
- s.substring(0, s.length - 2)); |
= |
- s.substring(0, s.length - 2)); |
+ assert.fail(`Messages without response: ${ |
<> |
+ common.fail(`Messages without response: ${ |
+ Object.keys(this.messages_).join(', ')}`); |
= |
+ Object.keys(this.messages_).join(', ')}`); |
}, TIMEOUT); |
|
}, TIMEOUT); |
}); |
|
}); |
}); |
|
}); |
|
|
|
if (!(expects instanceof Array)) expects = [ expects ]; |
|
if (!(expects instanceof Array)) expects = [ expects ]; |
|
|
|
const callback = this.createCallbackWithTimeout_( |
|
const callback = this.createCallbackWithTimeout_( |
- 'Matching response was not received:\n' + expects[0]); |
|
- 'Matching response was not received:\n' + expects[0]); |
+ `Matching response was not received:\n${expects[0]}`); |
|
+ `Matching response was not received:\n${expects[0]}`); |
|
|
= |
|
const expected = helper.mainScriptSource(); |
|
const expected = helper.mainScriptSource(); |
const source = result['scriptSource']; |
|
const source = result['scriptSource']; |
assert(source && (source.includes(expected)), |
|
assert(source && (source.includes(expected)), |
- 'Script source is wrong: ' + source); |
|
- 'Script source is wrong: ' + source); |
+ `Script source is wrong: ${source}`); |
|
+ `Script source is wrong: ${source}`); |
} |
|
} |
|
|
|
function setupExpectBreakOnLine(line, url, session, scopeIdCallback) { |
|
function setupExpectBreakOnLine(line, url, session, scopeIdCallback) { |
|
|
|
{ |
+- |
|
'method': 'Debugger.evaluateOnCallFrame', 'params': { |
|
|
'callFrameId': '{"ordinal":0,"injectedScriptId":1}', |
|
|
- 'expression': 'console.log("' + chars + '")', |
|
|
+ 'expression': `console.log("${chars}")`, |
|
|
'objectGroup': 'console', |
|
|
'includeCommandLineAPI': true, |
|
|
'silent': false, |
|
|
diff --git a/test/internet/test-dns-cares-domains.js b/test/internet/test-dns-cares-domains.js |
= |
diff --git a/test/internet/test-dns-cares-domains.js b/test/internet/test-dns-cares-domains.js |
|
|
|
--- a/test/internet/test-dns-cares-domains.js |
|
--- a/test/internet/test-dns-cares-domains.js |
+++ b/test/internet/test-dns-cares-domains.js |
|
+++ b/test/internet/test-dns-cares-domains.js |
|
|
|
const d = domain.create(); |
|
const d = domain.create(); |
d.run(function() { |
|
d.run(function() { |
dns[method]('google.com', function() { |
|
dns[method]('google.com', function() { |
- assert.strictEqual(process.domain, d, method + ' retains domain'); |
|
- assert.strictEqual(process.domain, d, method + ' retains domain'); |
+ assert.strictEqual(process.domain, d, `${method} retains domain`); |
|
+ assert.strictEqual(process.domain, d, `${method} retains domain`); |
|
+++ b/test/internet/test-tls-add-ca-cert.js |
= |
+++ b/test/internet/test-tls-add-ca-cert.js |
|
|
|
const tls = require('tls'); |
|
const tls = require('tls'); |
|
|
|
function filenamePEM(n) { |
|
function filenamePEM(n) { |
- return require('path').join(common.fixturesDir, 'keys', n + '.pem'); |
|
- return require('path').join(common.fixturesDir, 'keys', n + '.pem'); |
+ return require('path').join(common.fixturesDir, 'keys', `${n}.pem`); |
|
+ return require('path').join(common.fixturesDir, 'keys', `${n}.pem`); |
} |
|
} |
|
|
|
function loadPEM(n) { |
|
function loadPEM(n) { |
diff --git a/test/known_issues/test-cwd-enoent-file.js b/test/known_issues/test-cwd-enoent-file.js |
+- |
|
|
= |
|
--- a/test/known_issues/test-cwd-enoent-file.js |
+- |
|
+++ b/test/known_issues/test-cwd-enoent-file.js |
|
|
|
= |
|
// Do nothing. |
+- |
|
} else { |
|
|
common.refreshTmpDir(); |
|
|
- const dir = fs.mkdtempSync(common.tmpDir + '/'); |
|
|
+ const dir = fs.mkdtempSync(`${common.tmpDir}/`); |
|
|
process.chdir(dir); |
|
|
fs.rmdirSync(dir); |
|
|
assert.throws(process.cwd, |
|
|
diff --git a/test/parallel/test-assert.js b/test/parallel/test-assert.js |
= |
diff --git a/test/parallel/test-assert.js b/test/parallel/test-assert.js |
|
|
|
--- a/test/parallel/test-assert.js |
|
--- a/test/parallel/test-assert.js |
+++ b/test/parallel/test-assert.js |
|
+++ b/test/parallel/test-assert.js |
|
|
|
|
|
|
// having an identical prototype property |
|
// having an identical prototype property |
const nbRoot = { |
|
const nbRoot = { |
- toString: function() { return this.first + ' ' + this.last; } |
|
- toString: function() { return this.first + ' ' + this.last; } |
+ toString: function() { return `${this.first} ${this.last}`; } |
|
+ toString: function() { return `${this.first} ${this.last}`; } |
|
+++ b/test/parallel/test-async-wrap-check-providers.js |
= |
+++ b/test/parallel/test-async-wrap-check-providers.js |
|
|
|
// Run from closed net server above. |
|
// Run from closed net server above. |
function checkTLS() { |
|
function checkTLS() { |
const options = { |
|
const options = { |
- key: fs.readFileSync(common.fixturesDir + '/keys/ec-key.pem'), |
|
- key: fs.readFileSync(common.fixturesDir + '/keys/ec-key.pem'), |
- cert: fs.readFileSync(common.fixturesDir + '/keys/ec-cert.pem') |
|
- cert: fs.readFileSync(common.fixturesDir + '/keys/ec-cert.pem') |
+ key: fs.readFileSync(`${common.fixturesDir}/keys/ec-key.pem`), |
|
+ key: fs.readFileSync(`${common.fixturesDir}/keys/ec-key.pem`), |
+ cert: fs.readFileSync(`${common.fixturesDir}/keys/ec-cert.pem`) |
|
+ cert: fs.readFileSync(`${common.fixturesDir}/keys/ec-cert.pem`) |
}; |
|
}; |
const server = tls.createServer(options, common.noop) |
<> |
const server = tls.createServer(options, noop) |
.listen(0, function() { |
= |
.listen(0, function() { |
diff --git a/test/parallel/test-buffer-badhex.js b/test/parallel/test-buffer-badhex.js |
|
diff --git a/test/parallel/test-buffer-badhex.js b/test/parallel/test-buffer-badhex.js |
|
|
|
--- a/test/parallel/test-buffer-badhex.js |
|
--- a/test/parallel/test-buffer-badhex.js |
+++ b/test/parallel/test-buffer-badhex.js |
|
+++ b/test/parallel/test-buffer-badhex.js |
|
|
|
const hex = buf.toString('hex'); |
|
const hex = buf.toString('hex'); |
assert.deepStrictEqual(Buffer.from(hex, 'hex'), buf); |
|
assert.deepStrictEqual(Buffer.from(hex, 'hex'), buf); |
|
|
|
- const badHex = hex.slice(0, 256) + 'xx' + hex.slice(256, 510); |
|
- const badHex = hex.slice(0, 256) + 'xx' + hex.slice(256, 510); |
|
|
= |
|
--- a/test/parallel/test-child-process-fork.js |
|
--- a/test/parallel/test-child-process-fork.js |
+++ b/test/parallel/test-child-process-fork.js |
|
+++ b/test/parallel/test-child-process-fork.js |
|
|
|
const fork = require('child_process').fork; |
|
const fork = require('child_process').fork; |
const args = ['foo', 'bar']; |
|
const args = ['foo', 'bar']; |
|
|
|
-const n = fork(common.fixturesDir + '/child-process-spawn-node.js', args); |
|
-const n = fork(common.fixturesDir + '/child-process-spawn-node.js', args); |
+const n = fork(`${common.fixturesDir}/child-process-spawn-node.js`, args); |
|
+const n = fork(`${common.fixturesDir}/child-process-spawn-node.js`, args); |
|
|
|
assert.strictEqual(n.channel, n._channel); |
+- |
|
assert.deepStrictEqual(args, ['foo', 'bar']); |
= |
assert.deepStrictEqual(args, ['foo', 'bar']); |
|
|
|
|
-+ |
n.on('message', function(m) { |
diff --git a/test/parallel/test-child-process-fork3.js b/test/parallel/test-child-process-fork3.js |
= |
diff --git a/test/parallel/test-child-process-fork3.js b/test/parallel/test-child-process-fork3.js |
|
|
|
--- a/test/parallel/test-child-process-fork3.js |
|
--- a/test/parallel/test-child-process-fork3.js |
+++ b/test/parallel/test-child-process-fork3.js |
|
+++ b/test/parallel/test-child-process-fork3.js |
|
|
|
const common = require('../common'); |
|
const common = require('../common'); |
const child_process = require('child_process'); |
|
const child_process = require('child_process'); |
|
|
|
-child_process.fork(common.fixturesDir + '/empty.js'); // should not hang |
|
-child_process.fork(common.fixturesDir + '/empty.js'); // should not hang |
+child_process.fork(`${common.fixturesDir}/empty.js`); // should not hang |
|
+child_process.fork(`${common.fixturesDir}/empty.js`); // should not hang |
|
- assert.strictEqual(err.syscall, 'spawn ' + enoentPath); |
= |
- assert.strictEqual(err.syscall, 'spawn ' + enoentPath); |
+ assert.strictEqual(err.syscall, `spawn ${enoentPath}`); |
|
+ assert.strictEqual(err.syscall, `spawn ${enoentPath}`); |
assert.strictEqual(err.path, enoentPath); |
|
assert.strictEqual(err.path, enoentPath); |
assert.deepStrictEqual(err.spawnargs, spawnargs); |
|
assert.deepStrictEqual(err.spawnargs, spawnargs); |
})); |
|
})); |
diff --git a/test/parallel/test-child-process-spawn-typeerror.js b/test/parallel/test-child-process-spawn-typeerror.js |
|
diff --git a/test/parallel/test-child-process-spawn-typeerror.js b/test/parallel/test-child-process-spawn-typeerror.js |
|
|
|
--- a/test/parallel/test-child-process-spawn-typeerror.js |
|
--- a/test/parallel/test-child-process-spawn-typeerror.js |
+++ b/test/parallel/test-child-process-spawn-typeerror.js |
|
+++ b/test/parallel/test-child-process-spawn-typeerror.js |
|
|
|
|
<> |
const invalidcmd = 'hopefully_you_dont_have_this_on_your_machine'; |
@@ -32,7 +32,7 @@ const invalidArgsMsg = /Incorrect value of args option/; |
|
const invalidArgsMsg = /Incorrect value of args option/; |
const invalidOptionsMsg = /"options" argument must be an object/; |
= |
const invalidOptionsMsg = /"options" argument must be an object/; |
const invalidFileMsg = |
+- |
|
/^TypeError: "file" argument must be a non-empty string$/; |
|
|
-const empty = common.fixturesDir + '/empty.js'; |
= |
-const empty = common.fixturesDir + '/empty.js'; |
+const empty = `${common.fixturesDir}/empty.js`; |
|
+const empty = `${common.fixturesDir}/empty.js`; |
|
|
|
assert.throws(function() { |
|
assert.throws(function() { |
const child = spawn(invalidcmd, 'this is not an array'); |
|
const child = spawn(invalidcmd, 'this is not an array'); |
diff --git a/test/parallel/test-child-process-spawnsync-input.js b/test/parallel/test-child-process-spawnsync-input.js |
|
diff --git a/test/parallel/test-child-process-spawnsync-input.js b/test/parallel/test-child-process-spawnsync-input.js |
|
|
|
--- a/test/parallel/test-child-process-spawnsync-input.js |
|
--- a/test/parallel/test-child-process-spawnsync-input.js |
+++ b/test/parallel/test-child-process-spawnsync-input.js |
|
+++ b/test/parallel/test-child-process-spawnsync-input.js |
|
|
|
|
})); |
= |
})); |
|
|
|
// filename. |
|
// filename. |
const filecmd = `${nodejs} -- ${__filename} ${args}`; |
|
const filecmd = `${nodejs} -- ${__filename} ${args}`; |
child.exec(filecmd, common.mustCall(function(err, stdout, stderr) { |
|
child.exec(filecmd, common.mustCall(function(err, stdout, stderr) { |
- assert.strictEqual(stdout, args + '\n'); |
|
- assert.strictEqual(stdout, args + '\n'); |
+ assert.strictEqual(stdout, `${args}\n`); |
|
+ assert.strictEqual(stdout, `${args}\n`); |
assert.strictEqual(stderr, ''); |
|
assert.strictEqual(stderr, ''); |
assert.strictEqual(err, null); |
|
assert.strictEqual(err, null); |
})); |
|
})); |
diff --git a/test/parallel/test-cli-node-options.js b/test/parallel/test-cli-node-options.js |
+- |
|
|
= |
|
--- a/test/parallel/test-cli-node-options.js |
+- |
|
+++ b/test/parallel/test-cli-node-options.js |
|
|
|
= |
|
const options = {env: {NODE_OPTIONS: opt}}; |
+- |
|
exec(process.execPath, options, common.mustCall(function(err) { |
|
|
const message = err.message.split(/\r?\n/)[1]; |
|
|
- const expect = process.execPath + ': ' + opt + |
|
|
- ' is not allowed in NODE_OPTIONS'; |
|
|
+ const expect = `${process.execPath}: ${opt} is not allowed in NODE_OPTIONS`; |
|
|
|
= |
|
assert.strictEqual(err.code, 9); |
+- |
|
assert.strictEqual(message, expect); |
|
|
|
= |
|
|
|
|
const printA = require.resolve('../fixtures/printA.js'); |
+- |
|
|
= |
|
-expect('-r ' + printA, 'A\nB\n'); |
+- |
|
+expect(`-r ${printA}`, 'A\nB\n'); |
|
|
expect('--no-deprecation', 'B\n'); |
|
|
expect('--no-warnings', 'B\n'); |
|
|
expect('--trace-warnings', 'B\n'); |
|
|
|
= |
|
if (!RegExp(want).test(stdout)) { |
+- |
|
console.error('For %j, failed to find %j in: <\n%s\n>', |
|
|
opt, expect, stdout); |
|
|
- assert(false, 'Expected ' + expect); |
|
|
+ assert(false, `Expected ${expect}`); |
|
|
} |
|
|
})); |
|
|
} |
|
|
diff --git a/test/parallel/test-cli-syntax.js b/test/parallel/test-cli-syntax.js |
= |
diff --git a/test/parallel/test-cli-syntax.js b/test/parallel/test-cli-syntax.js |
|
|
|
--- a/test/parallel/test-cli-syntax.js |
|
--- a/test/parallel/test-cli-syntax.js |
+++ b/test/parallel/test-cli-syntax.js |
|
+++ b/test/parallel/test-cli-syntax.js |
|
|
|
// no output should be produced |
|
// no output should be produced |
assert.strictEqual(c.stdout, '', 'stdout produced'); |
|
assert.strictEqual(c.stdout, '', 'stdout produced'); |
assert.strictEqual(c.stderr, '', 'stderr produced'); |
|
assert.strictEqual(c.stderr, '', 'stderr produced'); |
- assert.strictEqual(c.status, 0, 'code === ' + c.status); |
<> |
- assert.strictEqual(c.status, 0, 'code == ' + c.status); |
+ assert.strictEqual(c.status, 0, `code === ${c.status}`); |
|
+ assert.strictEqual(c.status, 0, `code == ${c.status}`); |
}); |
= |
}); |
}); |
|
}); |
|
|
|
|
|
|
const match = c.stderr.match(/^SyntaxError: Unexpected identifier$/m); |
|
const match = c.stderr.match(/^SyntaxError: Unexpected identifier$/m); |
assert(match, 'stderr incorrect'); |
|
assert(match, 'stderr incorrect'); |
|
|
|
- assert.strictEqual(c.status, 1, 'code === ' + c.status); |
<> |
- assert.strictEqual(c.status, 1, 'code == ' + c.status); |
+ assert.strictEqual(c.status, 1, `code === ${c.status}`); |
|
+ assert.strictEqual(c.status, 1, `code == ${c.status}`); |
}); |
= |
}); |
}); |
|
}); |
|
|
|
|
|
|
const match = c.stderr.match(/^Error: Cannot find module/m); |
|
const match = c.stderr.match(/^Error: Cannot find module/m); |
assert(match, 'stderr incorrect'); |
|
assert(match, 'stderr incorrect'); |
|
|
|
- assert.strictEqual(c.status, 1, 'code === ' + c.status); |
<> |
- assert.strictEqual(c.status, 1, 'code == ' + c.status); |
+ assert.strictEqual(c.status, 1, `code === ${c.status}`); |
|
+ assert.strictEqual(c.status, 1, `code == ${c.status}`); |
}); |
= |
}); |
}); |
|
}); |
|
|
|
|
|
|
assert.strictEqual(c.stdout, '', 'stdout produced'); |
+- |
|
assert.strictEqual(c.stderr, '', 'stderr produced'); |
|
|
|
= |
|
- assert.strictEqual(c.status, 0, 'code === ' + c.status); |
+- |
|
+ assert.strictEqual(c.status, 0, `code === ${c.status}`); |
|
|
}); |
|
|
|
= |
|
// should throw if code piped from stdin with --check has bad syntax |
+- |
|
|
= |
|
const match = c.stderr.match(/^SyntaxError: Unexpected identifier$/m); |
+- |
|
assert(match, 'stderr incorrect'); |
|
|
|
= |
|
- assert.strictEqual(c.status, 1, 'code === ' + c.status); |
+- |
|
+ assert.strictEqual(c.status, 1, `code === ${c.status}`); |
|
|
}); |
|
|
|
= |
|
// should throw if -c and -e flags are both passed |
+- |
|
|
= |
|
) |
+- |
|
); |
|
|
|
= |
|
- assert.strictEqual(c.status, 9, 'code === ' + c.status); |
+- |
|
+ assert.strictEqual(c.status, 9, `code === ${c.status}`); |
|
|
}); |
|
|
}); |
|
|
diff --git a/test/parallel/test-cluster-bind-twice.js b/test/parallel/test-cluster-bind-twice.js |
= |
diff --git a/test/parallel/test-cluster-bind-twice.js b/test/parallel/test-cluster-bind-twice.js |
|
|
|
--- a/test/parallel/test-cluster-bind-twice.js |
|
--- a/test/parallel/test-cluster-bind-twice.js |
+++ b/test/parallel/test-cluster-bind-twice.js |
|
+++ b/test/parallel/test-cluster-bind-twice.js |
|
|
|
a.on('exit', common.mustCall((c) => { |
|
a.on('exit', common.mustCall((c) => { |
if (c) { |
|
if (c) { |
b.send('QUIT'); |
|
b.send('QUIT'); |
- throw new Error('A exited with ' + c); |
|
- throw new Error('A exited with ' + c); |
+ throw new Error(`A exited with ${c}`); |
|
+ throw new Error(`A exited with ${c}`); |
|
if (id === 'undefined') { |
= |
if (id === 'undefined') { |
const server = net.createServer(common.mustNotCall()); |
|
const server = net.createServer(common.mustNotCall()); |
diff --git a/test/parallel/test-cluster-message.js b/test/parallel/test-cluster-message.js |
|
diff --git a/test/parallel/test-cluster-message.js b/test/parallel/test-cluster-message.js |
|
|
|
--- a/test/parallel/test-cluster-message.js |
|
--- a/test/parallel/test-cluster-message.js |
+++ b/test/parallel/test-cluster-message.js |
|
+++ b/test/parallel/test-cluster-message.js |
|
|
|
if (data.code === 'received message') { |
|
if (data.code === 'received message') { |
check('worker', data.echo === 'message from master'); |
|
check('worker', data.echo === 'message from master'); |
} else { |
|
} else { |
- throw new Error('wrong TCP message received: ' + data); |
<> |
- throw new Error('wrong TCP message recived: ' + data); |
+ throw new Error(`wrong TCP message received: ${data}`); |
= |
+ throw new Error(`wrong TCP message received: ${data}`); |
} |
|
} |
}); |
|
}); |
|
|
|
|
|
|
|
|
|
process.once('exit', function() { |
|
process.once('exit', function() { |
forEach(checks, function(check, type) { |
|
forEach(checks, function(check, type) { |
- assert.ok(check.receive, 'The ' + type + ' did not receive any message'); |
|
- assert.ok(check.receive, 'The ' + type + ' did not receive any message'); |
- assert.ok(check.correct, |
|
- assert.ok(check.correct, |
|
- ' [pid:' + child.pid + '] OK.'); |
= |
- ' [pid:' + child.pid + '] OK.'); |
+ console.error(`Child #${++num_children_ok} [pid:${child.pid}] OK.`); |
|
+ console.error(`Child #${++num_children_ok} [pid:${child.pid}] OK.`); |
} |
|
} |
|
|
|
function responseHandler(buffer, expectedOutput) { |
|
function responseHandler(buffer, expectedOutput) { |
diff --git a/test/parallel/test-crypto-rsa-dsa.js b/test/parallel/test-crypto-rsa-dsa.js |
|
diff --git a/test/parallel/test-crypto-rsa-dsa.js b/test/parallel/test-crypto-rsa-dsa.js |
|
|
|
--- a/test/parallel/test-crypto-rsa-dsa.js |
|
--- a/test/parallel/test-crypto-rsa-dsa.js |
+++ b/test/parallel/test-crypto-rsa-dsa.js |
|
+++ b/test/parallel/test-crypto-rsa-dsa.js |
|
|
|
const constants = require('crypto').constants; |
<> |
} |
const crypto = require('crypto'); |
= |
const crypto = require('crypto'); |
|
|
|
+const fixtDir = common.fixturesDir; |
|
+const fixtDir = common.fixturesDir; |
+ |
|
+ |
// Test certificates |
|
// Test certificates |
-const certPem = fs.readFileSync(common.fixturesDir + '/test_cert.pem', 'ascii'); |
|
-const certPem = fs.readFileSync(common.fixturesDir + '/test_cert.pem', 'ascii'); |
-const keyPem = fs.readFileSync(common.fixturesDir + '/test_key.pem', 'ascii'); |
|
-const keyPem = fs.readFileSync(common.fixturesDir + '/test_key.pem', 'ascii'); |
-const rsaPubPem = fs.readFileSync(common.fixturesDir + '/test_rsa_pubkey.pem', |
|
-const rsaPubPem = fs.readFileSync(common.fixturesDir + '/test_rsa_pubkey.pem', |
- 'ascii'); |
|
- 'ascii'); |
-const rsaKeyPem = fs.readFileSync(common.fixturesDir + '/test_rsa_privkey.pem', |
|
-const rsaKeyPem = fs.readFileSync(common.fixturesDir + '/test_rsa_privkey.pem', |
|
- 'ascii'); |
= |
- 'ascii'); |
-const dsaKeyPem = fs.readFileSync(common.fixturesDir + '/test_dsa_privkey.pem', |
|
-const dsaKeyPem = fs.readFileSync(common.fixturesDir + '/test_dsa_privkey.pem', |
- 'ascii'); |
|
- 'ascii'); |
+ `${fixtDir}/test_rsa_privkey_encrypted.pem`, 'ascii'); |
|
+ `${fixtDir}/test_rsa_privkey_encrypted.pem`, 'ascii'); |
+const dsaPubPem = fs.readFileSync(`${fixtDir}/test_dsa_pubkey.pem`, 'ascii'); |
|
+const dsaPubPem = fs.readFileSync(`${fixtDir}/test_dsa_pubkey.pem`, 'ascii'); |
+const dsaKeyPem = fs.readFileSync(`${fixtDir}/test_dsa_privkey.pem`, 'ascii'); |
|
+const dsaKeyPem = fs.readFileSync(`${fixtDir}/test_dsa_privkey.pem`, 'ascii'); |
const dsaKeyPemEncrypted = fs.readFileSync( |
|
const dsaKeyPemEncrypted = fs.readFileSync( |
- common.fixturesDir + '/test_dsa_privkey_encrypted.pem', 'ascii'); |
|
- common.fixturesDir + '/test_dsa_privkey_encrypted.pem', 'ascii'); |
+ `${fixtDir}/test_dsa_privkey_encrypted.pem`, 'ascii'); |
|
+ `${fixtDir}/test_dsa_privkey_encrypted.pem`, 'ascii'); |
|
|
|
const decryptError = |
<> |
|
/^Error: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt$/; |
|
const decryptError = new RegExp('^Error: error:06065064:digital envelope ' + |
|
|
'routines:EVP_DecryptFinal_ex:bad decrypt$'); |
|
= |
|
// Test RSA signing and verification |
|
// Test RSA signing and verification |
// |
|
// |
{ |
|
{ |
- const privateKey = fs.readFileSync( |
|
- const privateKey = fs.readFileSync( |
- common.fixturesDir + '/test_rsa_privkey_2.pem'); |
|
- common.fixturesDir + '/test_rsa_privkey_2.pem'); |
+ const privateKey = fs.readFileSync(`${fixtDir}/test_rsa_privkey_2.pem`); |
|
+ const privateKey = fs.readFileSync(`${fixtDir}/test_rsa_privkey_2.pem`); |
|
|
|
- const publicKey = fs.readFileSync( |
|
- const publicKey = fs.readFileSync( |
- common.fixturesDir + '/test_rsa_pubkey_2.pem'); |
|
- common.fixturesDir + '/test_rsa_pubkey_2.pem'); |
|
--- a/test/parallel/test-crypto-sign-verify.js |
= |
--- a/test/parallel/test-crypto-sign-verify.js |
+++ b/test/parallel/test-crypto-sign-verify.js |
|
+++ b/test/parallel/test-crypto-sign-verify.js |
|
|
|
const crypto = require('crypto'); |
|
const crypto = require('crypto'); |
|
|
|
// Test certificates |
|
// Test certificates |
-const certPem = fs.readFileSync(common.fixturesDir + '/test_cert.pem', 'ascii'); |
|
-const certPem = fs.readFileSync(common.fixturesDir + '/test_cert.pem', 'ascii'); |
-const keyPem = fs.readFileSync(common.fixturesDir + '/test_key.pem', 'ascii'); |
|
-const keyPem = fs.readFileSync(common.fixturesDir + '/test_key.pem', 'ascii'); |
+const certPem = fs.readFileSync(`${common.fixturesDir}/test_cert.pem`, 'ascii'); |
|
+const certPem = fs.readFileSync(`${common.fixturesDir}/test_cert.pem`, 'ascii'); |
+const keyPem = fs.readFileSync(`${common.fixturesDir}/test_key.pem`, 'ascii'); |
|
+const keyPem = fs.readFileSync(`${common.fixturesDir}/test_key.pem`, 'ascii'); |
const modSize = 1024; |
+- |
|
|
= |
|
// Test signing and verifying |
|
// Test signing and verifying |
|
|
|
const msgfile = path.join(common.tmpDir, 's5.msg'); |
<> |
|
fs.writeFileSync(msgfile, msg); |
|
|
|
|
{ |
- const cmd = '"' + common.opensslCli + '" dgst -sha256 -verify "' + pubfile + |
|
|
- '" -signature "' + sigfile + |
|
|
- '" -sigopt rsa_padding_mode:pss -sigopt rsa_pss_saltlen:-2 "' + |
|
|
- msgfile + '"'; |
|
|
+ const cmd = |
|
|
+ `"${common.opensslCli}" dgst -sha256 -verify "${pubfile}" -signature "${ |
|
|
+ sigfile}" -sigopt rsa_padding_mode:pss -sigopt rsa_pss_saltlen:-2 "${ |
|
|
+ msgfile}"`; |
|
|
|
= |
|
exec(cmd, common.mustCall((err, stdout, stderr) => { |
+- |
|
assert(stdout.includes('Verified OK')); |
|
|
diff --git a/test/parallel/test-crypto-verify-failure.js b/test/parallel/test-crypto-verify-failure.js |
= |
diff --git a/test/parallel/test-crypto-verify-failure.js b/test/parallel/test-crypto-verify-failure.js |
|
|
|
--- a/test/parallel/test-crypto-verify-failure.js |
|
--- a/test/parallel/test-crypto-verify-failure.js |
+++ b/test/parallel/test-crypto-verify-failure.js |
|
+++ b/test/parallel/test-crypto-verify-failure.js |
|
|
|
|
|
|
const fs = require('fs'); |
|
const fs = require('fs'); |
|
|
|
-const certPem = fs.readFileSync(common.fixturesDir + '/test_cert.pem', 'ascii'); |
|
-const certPem = fs.readFileSync(common.fixturesDir + '/test_cert.pem', 'ascii'); |
+const certPem = fs.readFileSync(`${common.fixturesDir}/test_cert.pem`, 'ascii'); |
|
+const certPem = fs.readFileSync(`${common.fixturesDir}/test_cert.pem`, 'ascii'); |
|
- 'b not pushed: ' + names(domain._stack)); |
= |
- 'b not pushed: ' + names(domain._stack)); |
+ `b not pushed: ${names(domain._stack)}`); |
|
+ `b not pushed: ${names(domain._stack)}`); |
diff --git a/test/parallel/test-domain-uncaught-exception.js b/test/parallel/test-domain-uncaught-exception.js |
|
diff --git a/test/parallel/test-domain-uncaught-exception.js b/test/parallel/test-domain-uncaught-exception.js |
|
|
|
--- a/test/parallel/test-domain-uncaught-exception.js |
|
--- a/test/parallel/test-domain-uncaught-exception.js |
+++ b/test/parallel/test-domain-uncaught-exception.js |
|
+++ b/test/parallel/test-domain-uncaught-exception.js |
|
|
|
test.expectedMessages.forEach(function(expectedMessage) { |
|
test.expectedMessages.forEach(function(expectedMessage) { |
if (test.messagesReceived === undefined || |
|
if (test.messagesReceived === undefined || |
test.messagesReceived. |
|
test.messagesReceived. |
- assert.fail('test ' + test.fn.name + ' should have sent message: ' + |
<> |
- assert(false, 'test ' + test.fn.name + |
|
|
- ' should have sent message: ' + expectedMessage + |
- expectedMessage + ' but didn\'t'); |
|
- ' but didn\'t'); |
+ assert.fail(`test ${test.fn.name} should have sent message: ${ |
|
+ assert(false, `test ${test.fn.name} should have sent message: ${ |
+ expectedMessage} but didn't`); |
= |
+ expectedMessage} but didn't`); |
}); |
|
}); |
|
|
|
if (test.messagesReceived) { |
|
if (test.messagesReceived) { |
test.messagesReceived.forEach(function(receivedMessage) { |
|
test.messagesReceived.forEach(function(receivedMessage) { |
if (test.expectedMessages. |
|
if (test.expectedMessages. |
- assert.fail('test ' + test.fn.name + |
<> |
- assert(false, 'test ' + test.fn.name + |
- ' should not have sent message: ' + receivedMessage + |
= |
- ' should not have sent message: ' + receivedMessage + |
- ' but did'); |
|
- ' but did'); |
+ assert.fail(`test ${test.fn.name} should not have sent message: ${ |
<> |
+ assert(false, `test ${test.fn.name} should not have sent message: ${ |
+ receivedMessage} but did`); |
= |
+ receivedMessage} but did`); |
} |
|
} |
}); |
|
}); |
} |
|
} |
diff --git a/test/parallel/test-domain-with-abort-on-uncaught-exception.js b/test/parallel/test-domain-with-abort-on-uncaught-exception.js |
|
diff --git a/test/parallel/test-domain-with-abort-on-uncaught-exception.js b/test/parallel/test-domain-with-abort-on-uncaught-exception.js |
|
|
|
--- a/test/parallel/test-domain-with-abort-on-uncaught-exception.js |
|
--- a/test/parallel/test-domain-with-abort-on-uncaught-exception.js |
+++ b/test/parallel/test-domain-with-abort-on-uncaught-exception.js |
|
+++ b/test/parallel/test-domain-with-abort-on-uncaught-exception.js |
|
|
|
if (options.useTryCatch) |
|
if (options.useTryCatch) |
|
-const expected = util.format([process.execPath, 'foo', 'bar']) + '\n'; |
= |
-const expected = util.format([process.execPath, 'foo', 'bar']) + '\n'; |
+const expected = `${util.format([process.execPath, 'foo', 'bar'])}\n`; |
|
+const expected = `${util.format([process.execPath, 'foo', 'bar'])}\n`; |
exec(cmd, common.mustCall((err, stdout, stderr) => { |
|
exec(cmd, common.mustCall((err, stdout, stderr) => { |
assert.ifError(err); |
|
assert.ifError(err); |
assert.strictEqual(stderr, expected); |
|
assert.strictEqual(stderr, expected); |
diff --git a/test/parallel/test-exception-handler2.js b/test/parallel/test-exception-handler2.js |
|
diff --git a/test/parallel/test-exception-handler2.js b/test/parallel/test-exception-handler2.js |
|
|
|
--- a/test/parallel/test-exception-handler2.js |
|
--- a/test/parallel/test-exception-handler2.js |
+++ b/test/parallel/test-exception-handler2.js |
|
+++ b/test/parallel/test-exception-handler2.js |
|
|
|
@@ -24,7 +24,7 @@ const common = require('../common'); |
<> |
const common = require('../common'); |
const assert = require('assert'); |
|
|
|
= |
|
process.on('uncaughtException', function(err) { |
|
process.on('uncaughtException', function(err) { |
- console.log('Caught exception: ' + err); |
|
- console.log('Caught exception: ' + err); |
+ console.log(`Caught exception: ${err}`); |
|
+ console.log(`Caught exception: ${err}`); |
}); |
|
}); |
|
|
|
setTimeout(common.mustCall(function() { |
|
setTimeout(common.mustCall(function() { |
diff --git a/test/parallel/test-file-write-stream2.js b/test/parallel/test-file-write-stream2.js |
|
diff --git a/test/parallel/test-file-write-stream2.js b/test/parallel/test-file-write-stream2.js |
|
|
|
--- a/test/parallel/test-file-write-stream2.js |
|
--- a/test/parallel/test-file-write-stream2.js |
|
- cb('' + stderr); |
= |
- cb('' + stderr); |
+ cb(String(stderr)); |
|
+ cb(String(stderr)); |
})); |
|
})); |
} |
|
} |
|
|
|
diff --git a/test/parallel/test-fs-realpath.js b/test/parallel/test-fs-realpath.js |
|
diff --git a/test/parallel/test-fs-realpath.js b/test/parallel/test-fs-realpath.js |
|
|
|
--- a/test/parallel/test-fs-realpath.js |
|
--- a/test/parallel/test-fs-realpath.js |
+++ b/test/parallel/test-fs-realpath.js |
|
+++ b/test/parallel/test-fs-realpath.js |
|
|
|
let async_expected = 0; |
<> |
let async_completed = 0, async_expected = 0; |
const unlink = []; |
= |
const unlink = []; |
let skipSymlinks = false; |
|
let skipSymlinks = false; |
+const tmpDir = common.tmpDir; |
|
+const tmpDir = common.tmpDir; |
|
|
|
common.refreshTmpDir(); |
|
common.refreshTmpDir(); |
|
|
|
|
|
|
|
|
|
|
|
|
function tmp(p) { |
|
function tmp(p) { |
|
} |
= |
} |
setup(); |
|
setup(); |
- const linkPath = root + '/a/link/c/x.txt'; |
|
- const linkPath = root + '/a/link/c/x.txt'; |
- const expectPath = root + '/a/b/c/x.txt'; |
|
- const expectPath = root + '/a/b/c/x.txt'; |
+ const linkPath = `${root}/a/link/c/x.txt`; |
|
+ const linkPath = `${root}/a/link/c/x.txt`; |
+ const expectPath = `${root}/a/b/c/x.txt`; |
|
+ const expectPath = `${root}/a/b/c/x.txt`; |
const actual = fs.realpathSync(linkPath); |
|
const actual = fs.realpathSync(linkPath); |
// console.log({link:linkPath,expect:expectPath,actual:actual},'sync'); |
|
// console.log({link:linkPath,expect:expectPath,actual:actual},'sync'); |
assertEqualPath(actual, path.resolve(expectPath)); |
|
assertEqualPath(actual, path.resolve(expectPath)); |
|
|
|
assert.ifError(err); |
<> |
if (err) throw err; |
const test = tests.shift(); |
= |
const test = tests.shift(); |
if (!test) { |
|
if (!test) { |
- return console.log(numtests + |
|
- return console.log(numtests + |
- ' subtests completed OK for fs.realpath'); |
|
- ' subtests completed OK for fs.realpath'); |
+ return console.log(`${numtests} subtests completed OK for fs.realpath`); |
|
+ return console.log(`${numtests} subtests completed OK for fs.realpath`); |
} |
|
} |
testsRun++; |
|
testsRun++; |
test(runNextTest); |
|
test(runNextTest); |
diff --git a/test/parallel/test-fs-sir-writes-alot.js b/test/parallel/test-fs-sir-writes-alot.js |
|
diff --git a/test/parallel/test-fs-sir-writes-alot.js b/test/parallel/test-fs-sir-writes-alot.js |
|
|
|
|
|
= |
|
|
|
|
common.refreshTmpDir(); |
|
common.refreshTmpDir(); |
|
|
|
-console.log('linkData: ' + linkData); |
|
-console.log('linkData: ' + linkData); |
-console.log('linkPath: ' + linkPath); |
|
-console.log('linkPath: ' + linkPath); |
+console.log(`linkData: ${linkData}`); |
|
+console.log(`linkData: ${linkData}`); |
+console.log(`linkPath: ${linkPath}`); |
|
+console.log(`linkPath: ${linkPath}`); |
|
|
|
fs.symlink(linkData, linkPath, 'junction', common.mustCall(function(err) { |
|
fs.symlink(linkData, linkPath, 'junction', common.mustCall(function(err) { |
assert.ifError(err); |
<> |
if (err) throw err; |
diff --git a/test/parallel/test-fs-timestamp-parsing-error.js b/test/parallel/test-fs-timestamp-parsing-error.js |
|
|
|
= |
|
--- a/test/parallel/test-fs-timestamp-parsing-error.js |
+- |
|
+++ b/test/parallel/test-fs-timestamp-parsing-error.js |
|
|
|
= |
|
|
|
|
[Infinity, -Infinity, NaN].forEach((input) => { |
+- |
|
assert.throws(() => fs._toUnixTimestamp(input), |
|
|
- new RegExp('^Error: Cannot parse time: ' + input + '$')); |
|
|
+ new RegExp(`^Error: Cannot parse time: ${input}$`)); |
|
|
}); |
|
|
|
= |
|
assert.throws(() => fs._toUnixTimestamp({}), |
+- |
|
diff --git a/test/parallel/test-fs-truncate-GH-6233.js b/test/parallel/test-fs-truncate-GH-6233.js |
= |
diff --git a/test/parallel/test-fs-truncate-GH-6233.js b/test/parallel/test-fs-truncate-GH-6233.js |
|
|
|
--- a/test/parallel/test-fs-truncate-GH-6233.js |
|
--- a/test/parallel/test-fs-truncate-GH-6233.js |
+++ b/test/parallel/test-fs-truncate-GH-6233.js |
|
+++ b/test/parallel/test-fs-truncate-GH-6233.js |
|
|
|
const assert = require('assert'); |
|
const assert = require('assert'); |
const fs = require('fs'); |
|
const fs = require('fs'); |
|
|
|
-const filename = common.tmpDir + '/truncate-file.txt'; |
|
-const filename = common.tmpDir + '/truncate-file.txt'; |
+const filename = `${common.tmpDir}/truncate-file.txt`; |
|
+const filename = `${common.tmpDir}/truncate-file.txt`; |
|
--- a/test/parallel/test-fs-write-string-coerce.js |
= |
--- a/test/parallel/test-fs-write-string-coerce.js |
+++ b/test/parallel/test-fs-write-string-coerce.js |
|
+++ b/test/parallel/test-fs-write-string-coerce.js |
|
|
|
|
|
|
const fn = path.join(common.tmpDir, 'write-string-coerce.txt'); |
|
const fn = path.join(common.tmpDir, 'write-string-coerce.txt'); |
const data = true; |
|
const data = true; |
-const expected = data + ''; |
|
-const expected = data + ''; |
+const expected = String(data); |
|
+const expected = String(data); |
|
|
|
fs.open(fn, 'w', 0o644, common.mustCall(function(err, fd) { |
|
fs.open(fn, 'w', 0o644, common.mustCall(function(err, fd) { |
assert.ifError(err); |
<> |
if (err) throw err; |
diff --git a/test/parallel/test-http-abort-client.js b/test/parallel/test-http-abort-client.js |
= |
diff --git a/test/parallel/test-http-abort-client.js b/test/parallel/test-http-abort-client.js |
|
|
|
--- a/test/parallel/test-http-abort-client.js |
|
--- a/test/parallel/test-http-abort-client.js |
+++ b/test/parallel/test-http-abort-client.js |
|
+++ b/test/parallel/test-http-abort-client.js |
|
|
|
}, common.mustCall(function(res) { |
|
}, common.mustCall(function(res) { |
server.close(); |
|
server.close(); |
|
|
|
- console.log('Got res: ' + res.statusCode); |
|
- console.log('Got res: ' + res.statusCode); |
+ console.log(`Got res: ${res.statusCode}`); |
|
+ console.log(`Got res: ${res.statusCode}`); |
|
- const name = 'localhost:' + server.address().port; |
= |
- const name = 'localhost:' + server.address().port; |
+ const name = `localhost:${server.address().port}`; |
|
+ const name = `localhost:${server.address().port}`; |
assert(!http.globalAgent.sockets.hasOwnProperty(name)); |
|
assert(!http.globalAgent.sockets.hasOwnProperty(name)); |
assert(!http.globalAgent.requests.hasOwnProperty(name)); |
|
assert(!http.globalAgent.requests.hasOwnProperty(name)); |
|
|
|
diff --git a/test/parallel/test-http-contentLength0.js b/test/parallel/test-http-contentLength0.js |
|
diff --git a/test/parallel/test-http-contentLength0.js b/test/parallel/test-http-contentLength0.js |
|
|
|
--- a/test/parallel/test-http-contentLength0.js |
|
--- a/test/parallel/test-http-contentLength0.js |
+++ b/test/parallel/test-http-contentLength0.js |
|
+++ b/test/parallel/test-http-contentLength0.js |
|
|
|
s.listen(0, function() { |
<> |
@@ -15,7 +15,7 @@ s.listen(0, function() { |
|
= |
|
|
<> |
const request = |
const request = http.request({ port: this.address().port }, (response) => { |
|
http.request({ port: this.address().port }, function(response) { |
- console.log('STATUS: ' + response.statusCode); |
= |
- console.log('STATUS: ' + response.statusCode); |
+ console.log(`STATUS: ${response.statusCode}`); |
|
+ console.log(`STATUS: ${response.statusCode}`); |
s.close(); |
|
s.close(); |
response.resume(); |
|
response.resume(); |
}); |
|
}); |
diff --git a/test/parallel/test-http-default-port.js b/test/parallel/test-http-default-port.js |
|
diff --git a/test/parallel/test-http-default-port.js b/test/parallel/test-http-default-port.js |
|
|
|
--- a/test/parallel/test-http-default-port.js |
|
--- a/test/parallel/test-http-default-port.js |
+++ b/test/parallel/test-http-default-port.js |
|
+++ b/test/parallel/test-http-default-port.js |
|
|
|
|
|
= |
|
common.refreshTmpDir(); |
|
common.refreshTmpDir(); |
|
|
|
-const image = fs.readFileSync(common.fixturesDir + '/person.jpg'); |
|
-const image = fs.readFileSync(common.fixturesDir + '/person.jpg'); |
+const image = fs.readFileSync(`${common.fixturesDir}/person.jpg`); |
|
+const image = fs.readFileSync(`${common.fixturesDir}/person.jpg`); |
|
|
|
-console.log('image.length = ' + image.length); |
|
-console.log('image.length = ' + image.length); |
+console.log(`image.length = ${image.length}`); |
|
+console.log(`image.length = ${image.length}`); |
|
|
|
const total = 10; |
|
const total = 10; |
let requests = 0; |
<> |
let requests = 0, responses = 0; |
|
= |
|
}; |
|
}; |
|
|
|
http.get(opts, function(res) { |
|
http.get(opts, function(res) { |
- console.error('recv ' + x); |
|
- console.error('recv ' + x); |
- const s = fs.createWriteStream(common.tmpDir + '/' + x + '.jpg'); |
|
- const s = fs.createWriteStream(common.tmpDir + '/' + x + '.jpg'); |
+ console.error(`recv ${x}`); |
|
+ console.error(`recv ${x}`); |
+ const s = fs.createWriteStream(`${common.tmpDir}/${x}.jpg`); |
|
+ const s = fs.createWriteStream(`${common.tmpDir}/${x}.jpg`); |
res.pipe(s); |
|
res.pipe(s); |
|
|
|
|
|
= |
|
req.on('end', function() { |
|
req.on('end', function() { |
res.writeHead(200, { 'Content-Type': 'text/plain' }); |
|
res.writeHead(200, { 'Content-Type': 'text/plain' }); |
- res.end('You are from: ' + req.connection.remoteAddress); |
|
- res.end('You are from: ' + req.connection.remoteAddress); |
+ res.end(`You are from: ${req.connection.remoteAddress}`); |
|
+ res.end(`You are from: ${req.connection.remoteAddress}`); |
}); |
|
}); |
req.resume(); |
|
req.resume(); |
}); |
|
}); |
|
|
|
}, function(res) { |
|
}, function(res) { |
assert.fail('unexpectedly got response from server'); |
<> |
common.fail('unexpectedly got response from server'); |
}).on('error', common.mustCall(function(e) { |
= |
}).on('error', common.mustCall(function(e) { |
- console.log('client got error: ' + e.message); |
|
- console.log('client got error: ' + e.message); |
+ console.log(`client got error: ${e.message}`); |
|
+ console.log(`client got error: ${e.message}`); |
server.close(); |
|
server.close(); |
})).end(); |
|
})).end(); |
})); |
|
})); |
diff --git a/test/parallel/test-http-localaddress.js b/test/parallel/test-http-localaddress.js |
|
diff --git a/test/parallel/test-http-localaddress.js b/test/parallel/test-http-localaddress.js |
|
|
|
--- a/test/parallel/test-http-localaddress.js |
|
--- a/test/parallel/test-http-localaddress.js |
+++ b/test/parallel/test-http-localaddress.js |
|
+++ b/test/parallel/test-http-localaddress.js |
|
|
= |
|
|
|
|
const srv = http.createServer(function(req, res) { |
|
const srv = http.createServer(function(req, res) { |
multipleForbidden.forEach(function(header) { |
|
multipleForbidden.forEach(function(header) { |
- assert.strictEqual(req.headers[header.toLowerCase()], |
|
- assert.strictEqual(req.headers[header.toLowerCase()], |
- 'foo', 'header parsed incorrectly: ' + header); |
|
- 'foo', 'header parsed incorrectly: ' + header); |
+ assert.strictEqual(req.headers[header.toLowerCase()], 'foo', |
|
+ assert.strictEqual(req.headers[header.toLowerCase()], 'foo', |
+ `header parsed incorrectly: ${header}`); |
|
+ `header parsed incorrectly: ${header}`); |
}); |
|
}); |
multipleAllowed.forEach(function(header) { |
|
multipleAllowed.forEach(function(header) { |
const sep = (header.toLowerCase() === 'cookie' ? '; ' : ', '); |
<> |
|
- assert.strictEqual(req.headers[header.toLowerCase()], |
|
assert.strictEqual(req.headers[header.toLowerCase()], |
- 'foo' + sep + 'bar', |
|
|
- 'header parsed incorrectly: ' + header); |
|
- 'foo, bar', 'header parsed incorrectly: ' + header); |
+ assert.strictEqual(req.headers[header.toLowerCase()], `foo${sep}bar`, |
|
|
+ `header parsed incorrectly: ${header}`); |
|
+ 'foo, bar', `header parsed incorrectly: ${header}`); |
}); |
= |
}); |
|
|
|
res.writeHead(200, {'Content-Type': 'text/plain'}); |
|
res.writeHead(200, {'Content-Type': 'text/plain'}); |
diff --git a/test/parallel/test-http-should-keep-alive.js b/test/parallel/test-http-should-keep-alive.js |
|
diff --git a/test/parallel/test-http-should-keep-alive.js b/test/parallel/test-http-should-keep-alive.js |
|
|
|
--- a/test/parallel/test-http-should-keep-alive.js |
|
--- a/test/parallel/test-http-should-keep-alive.js |
+++ b/test/parallel/test-http-should-keep-alive.js |
|
+++ b/test/parallel/test-http-should-keep-alive.js |
|
|
|
}).listen(0, function() { |
|
}).listen(0, function() { |
function makeRequest() { |
|
function makeRequest() { |
|
|
= |
|
--- a/test/parallel/test-http.js |
|
--- a/test/parallel/test-http.js |
+++ b/test/parallel/test-http.js |
|
+++ b/test/parallel/test-http.js |
|
|
|
|
|
|
req.on('end', function() { |
|
req.on('end', function() { |
res.writeHead(200, {'Content-Type': 'text/plain'}); |
|
res.writeHead(200, {'Content-Type': 'text/plain'}); |
- res.write('The path was ' + url.parse(req.url).pathname); |
|
- res.write('The path was ' + url.parse(req.url).pathname); |
+ res.write(`The path was ${url.parse(req.url).pathname}`); |
|
+ res.write(`The path was ${url.parse(req.url).pathname}`); |
res.end(); |
|
res.end(); |
|
-+ |
responses_sent += 1; |
}); |
= |
}); |
req.resume(); |
+- |
|
diff --git a/test/parallel/test-https-agent-create-connection.js b/test/parallel/test-https-agent-create-connection.js |
= |
diff --git a/test/parallel/test-https-agent-create-connection.js b/test/parallel/test-https-agent-create-connection.js |
|
|
|
--- a/test/parallel/test-https-agent-create-connection.js |
|
--- a/test/parallel/test-https-agent-create-connection.js |
+++ b/test/parallel/test-https-agent-create-connection.js |
|
+++ b/test/parallel/test-https-agent-create-connection.js |
|
|
|
const fs = require('fs'); |
|
const fs = require('fs'); |
|
|
|
const options = { |
|
const options = { |
- key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), |
|
- key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), |
- cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem'), |
|
- cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem'), |
+ key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), |
|
+ key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), |
+ cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`), |
|
+ cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`), |
}; |
|
}; |
|
|
|
const expectedHeader = /^HTTP\/1\.1 200 OK/; |
<> |
const expectedHeader = /^HTTP\/1.1 200 OK/; |
diff --git a/test/parallel/test-https-agent-disable-session-reuse.js b/test/parallel/test-https-agent-disable-session-reuse.js |
= |
diff --git a/test/parallel/test-https-agent-disable-session-reuse.js b/test/parallel/test-https-agent-disable-session-reuse.js |
|
|
|
--- a/test/parallel/test-https-agent-disable-session-reuse.js |
|
--- a/test/parallel/test-https-agent-disable-session-reuse.js |
+++ b/test/parallel/test-https-agent-disable-session-reuse.js |
|
+++ b/test/parallel/test-https-agent-disable-session-reuse.js |
|
|
|
const fs = require('fs'); |
|
const fs = require('fs'); |
|
|
|
const options = { |
|
const options = { |
- key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), |
|
- key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), |
- cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem') |
|
- cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem') |
+ key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), |
|
+ key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), |
+ cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`) |
|
+ cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`) |
}; |
|
}; |
|
|
|
const clientSessions = []; |
|
const clientSessions = []; |
diff --git a/test/parallel/test-https-agent-secure-protocol.js b/test/parallel/test-https-agent-secure-protocol.js |
+- |
|
|
= |
|
--- a/test/parallel/test-https-agent-secure-protocol.js |
+- |
|
+++ b/test/parallel/test-https-agent-secure-protocol.js |
|
|
|
= |
|
const fs = require('fs'); |
+- |
|
|
= |
|
const options = { |
+- |
|
- key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), |
|
|
- cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem'), |
|
|
- ca: fs.readFileSync(common.fixturesDir + '/keys/ca1-cert.pem') |
|
|
+ key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), |
|
|
+ cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`), |
|
|
+ ca: fs.readFileSync(`${common.fixturesDir}/keys/ca1-cert.pem`) |
|
|
}; |
|
|
|
= |
|
const server = https.Server(options, function(req, res) { |
+- |
|
diff --git a/test/parallel/test-https-agent-servername.js b/test/parallel/test-https-agent-servername.js |
= |
diff --git a/test/parallel/test-https-agent-servername.js b/test/parallel/test-https-agent-servername.js |
|
|
|
--- a/test/parallel/test-https-agent-servername.js |
|
--- a/test/parallel/test-https-agent-servername.js |
+++ b/test/parallel/test-https-agent-servername.js |
|
+++ b/test/parallel/test-https-agent-servername.js |
|
|
|
const fs = require('fs'); |
|
const fs = require('fs'); |
|
|
|
const options = { |
|
const options = { |
- key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), |
|
- key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), |
- cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem'), |
|
- cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem'), |
|
+ key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), |
= |
+ key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), |
+ cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`) |
|
+ cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`) |
}; |
|
}; |
|
|
|
const body = 'hello world\n'; |
|
const body = 'hello world\n'; |
diff --git a/test/parallel/test-https-client-get-url.js b/test/parallel/test-https-client-get-url.js |
|
diff --git a/test/parallel/test-https-client-get-url.js b/test/parallel/test-https-client-get-url.js |
|
|
|
--- a/test/parallel/test-https-client-get-url.js |
|
--- a/test/parallel/test-https-client-get-url.js |
+++ b/test/parallel/test-https-client-get-url.js |
|
+++ b/test/parallel/test-https-client-get-url.js |
|
|
|
const URL = url.URL; |
<> |
const fs = require('fs'); |
|
= |
|
const options = { |
|
const options = { |
- key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), |
|
- key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), |
- cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem') |
|
- cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem') |
+ key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), |
|
+ key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), |
+ cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`) |
|
+ cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`) |
}; |
|
}; |
|
|
|
const server = https.createServer(options, common.mustCall(function(req, res) { |
|
const server = https.createServer(options, common.mustCall(function(req, res) { |
diff --git a/test/parallel/test-https-client-resume.js b/test/parallel/test-https-client-resume.js |
|
diff --git a/test/parallel/test-https-client-resume.js b/test/parallel/test-https-client-resume.js |
|
--- a/test/parallel/test-https-foafssl.js |
= |
--- a/test/parallel/test-https-foafssl.js |
+++ b/test/parallel/test-https-foafssl.js |
|
+++ b/test/parallel/test-https-foafssl.js |
|
|
|
const https = require('https'); |
|
const https = require('https'); |
|
|
|
const options = { |
|
const options = { |
- key: fs.readFileSync(common.fixturesDir + '/agent.key'), |
|
- key: fs.readFileSync(common.fixturesDir + '/agent.key'), |
- cert: fs.readFileSync(common.fixturesDir + '/agent.crt'), |
|
- cert: fs.readFileSync(common.fixturesDir + '/agent.crt'), |
+ key: fs.readFileSync(`${common.fixturesDir}/agent.key`), |
|
+ key: fs.readFileSync(`${common.fixturesDir}/agent.key`), |
+ cert: fs.readFileSync(`${common.fixturesDir}/agent.crt`), |
|
+ cert: fs.readFileSync(`${common.fixturesDir}/agent.crt`), |
requestCert: true, |
<> |
requestCert: true |
rejectUnauthorized: false |
|
|
}; |
= |
}; |
|
|
|
diff --git a/test/parallel/test-https-host-headers.js b/test/parallel/test-https-host-headers.js |
|
diff --git a/test/parallel/test-https-host-headers.js b/test/parallel/test-https-host-headers.js |
|
|
|
--- a/test/parallel/test-https-host-headers.js |
|
--- a/test/parallel/test-https-host-headers.js |
+++ b/test/parallel/test-https-host-headers.js |
|
+++ b/test/parallel/test-https-host-headers.js |
|
|
|
|
|
|
const fs = require('fs'); |
|
const fs = require('fs'); |
const options = { |
|
const options = { |
|
|
= |
|
|
|
|
function cb(res) { |
|
function cb(res) { |
counter--; |
|
counter--; |
- console.log('back from https request. counter = ' + counter); |
|
- console.log('back from https request. counter = ' + counter); |
+ console.log(`back from https request. counter = ${counter}`); |
|
+ console.log(`back from https request. counter = ${counter}`); |
if (counter === 0) { |
|
if (counter === 0) { |
httpsServer.close(); |
|
httpsServer.close(); |
console.log('ok'); |
|
console.log('ok'); |
|
|
|
assert.ifError(er); |
<> |
|
https.get({ |
= |
https.get({ |
method: 'GET', |
|
method: 'GET', |
- path: '/' + (counter++), |
|
- path: '/' + (counter++), |
+ path: `/${counter++}`, |
|
+ path: `/${counter++}`, |
host: 'localhost', |
|
host: 'localhost', |
//agent: false, |
|
//agent: false, |
port: this.address().port, |
|
port: this.address().port, |
|
|
|
|
|
|
https.request({ |
|
https.request({ |
|
|
= |
|
req.on('end', function() { |
|
req.on('end', function() { |
res.writeHead(200, { 'Content-Type': 'text/plain' }); |
|
res.writeHead(200, { 'Content-Type': 'text/plain' }); |
- res.end('You are from: ' + req.connection.remoteAddress); |
|
- res.end('You are from: ' + req.connection.remoteAddress); |
+ res.end(`You are from: ${req.connection.remoteAddress}`); |
|
+ res.end(`You are from: ${req.connection.remoteAddress}`); |
}); |
|
}); |
req.resume(); |
|
req.resume(); |
}); |
|
}); |
|
|
|
}, function(res) { |
|
}, function(res) { |
assert.fail('unexpectedly got response from server'); |
<> |
common.fail('unexpectedly got response from server'); |
}).on('error', common.mustCall(function(e) { |
= |
}).on('error', common.mustCall(function(e) { |
- console.log('client got error: ' + e.message); |
|
- console.log('client got error: ' + e.message); |
+ console.log(`client got error: ${e.message}`); |
|
+ console.log(`client got error: ${e.message}`); |
server.close(); |
|
server.close(); |
})).end(); |
|
})).end(); |
})); |
|
})); |
diff --git a/test/parallel/test-https-localaddress.js b/test/parallel/test-https-localaddress.js |
|
diff --git a/test/parallel/test-https-localaddress.js b/test/parallel/test-https-localaddress.js |
|
|
|
--- a/test/parallel/test-https-localaddress.js |
|
--- a/test/parallel/test-https-localaddress.js |
+++ b/test/parallel/test-https-localaddress.js |
|
+++ b/test/parallel/test-https-localaddress.js |
|
+ key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), |
= |
+ key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), |
+ cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`) |
|
+ cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`) |
}; |
|
}; |
|
|
|
const body = 'hello world\n'; |
|
const body = 'hello world\n'; |
diff --git a/test/parallel/test-https-strict.js b/test/parallel/test-https-strict.js |
|
diff --git a/test/parallel/test-https-strict.js b/test/parallel/test-https-strict.js |
|
|
|
--- a/test/parallel/test-https-strict.js |
|
--- a/test/parallel/test-https-strict.js |
+++ b/test/parallel/test-https-strict.js |
|
+++ b/test/parallel/test-https-strict.js |
|
|
|
port === server2.address().port ? server2 : |
<> |
|
port === server3.address().port ? server3 : |
|
: port === server3.address().port ? server3 |
null; |
|
: null; |
|
= |
|
- if (!server) throw new Error('invalid port: ' + port); |
|
- if (!server) throw new Error('invalid port: ' + port); |
+ if (!server) throw new Error(`invalid port: ${port}`); |
|
+ if (!server) throw new Error(`invalid port: ${port}`); |
server.expectCount++; |
|
server.expectCount++; |
|
|
|
req.on('response', common.mustCall((res) => { |
<> |
req.on('response', function(res) { |
diff --git a/test/parallel/test-https-timeout-server-2.js b/test/parallel/test-https-timeout-server-2.js |
= |
diff --git a/test/parallel/test-https-timeout-server-2.js b/test/parallel/test-https-timeout-server-2.js |
|
|
|
--- a/test/parallel/test-https-timeout-server-2.js |
|
--- a/test/parallel/test-https-timeout-server-2.js |
+++ b/test/parallel/test-https-timeout-server-2.js |
|
+++ b/test/parallel/test-https-timeout-server-2.js |
|
|
|
const fs = require('fs'); |
|
const fs = require('fs'); |
|
|
|
const options = { |
|
const options = { |
- key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), |
|
- key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), |
- cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem') |
|
- cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem') |
|
+const cert = fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`); |
= |
+const cert = fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`); |
|
|
|
// number of bytes discovered empirically to trigger the bug |
|
// number of bytes discovered empirically to trigger the bug |
const data = Buffer.alloc(1024 * 32 + 1); |
|
const data = Buffer.alloc(1024 * 32 + 1); |
diff --git a/test/parallel/test-intl.js b/test/parallel/test-intl.js |
|
diff --git a/test/parallel/test-intl.js b/test/parallel/test-intl.js |
|
|
|
--- a/test/parallel/test-intl.js |
|
--- a/test/parallel/test-intl.js |
+++ b/test/parallel/test-intl.js |
|
+++ b/test/parallel/test-intl.js |
|
|
|
|
|
|
if (!common.hasIntl) { |
<> |
if (!haveIntl) { |
const erMsg = |
= |
const erMsg = |
- '"Intl" object is NOT present but v8_enable_i18n_support is ' + |
|
- '"Intl" object is NOT present but v8_enable_i18n_support is ' + |
- enablei18n; |
|
- enablei18n; |
+ `"Intl" object is NOT present but v8_enable_i18n_support is ${enablei18n}`; |
|
+ `"Intl" object is NOT present but v8_enable_i18n_support is ${enablei18n}`; |
assert.strictEqual(enablei18n, 0, erMsg); |
|
assert.strictEqual(enablei18n, 0, erMsg); |
common.skip('Intl tests because Intl object not present.'); |
|
common.skip('Intl tests because Intl object not present.'); |
|
|
|
} else { |
|
} else { |
const erMsg = |
|
const erMsg = |
- '"Intl" object is present but v8_enable_i18n_support is ' + |
|
- '"Intl" object is present but v8_enable_i18n_support is ' + |
|
}); |
= |
}); |
|
|
|
connectHappened = true; |
|
connectHappened = true; |
}); |
|
}); |
|
|
|
- console.log('connecting = ' + socket.connecting); |
|
- console.log('connecting = ' + socket.connecting); |
+ console.log(`connecting = ${socket.connecting}`); |
|
+ console.log(`connecting = ${socket.connecting}`); |
|
|
|
assert.strictEqual('opening', socket.readyState); |
|
assert.strictEqual('opening', socket.readyState); |
|
|
|
diff --git a/test/parallel/test-net-connect-options-allowhalfopen.js b/test/parallel/test-net-connect-options-allowhalfopen.js |
+- |
|
|
= |
|
--- a/test/parallel/test-net-connect-options-allowhalfopen.js |
+- |
|
+++ b/test/parallel/test-net-connect-options-allowhalfopen.js |
|
|
|
= |
|
console.error(`No. ${index} client received FIN`); |
+- |
|
assert(!client.readable); |
|
|
assert(client.writable); |
|
|
- assert(client.write(index + '')); |
|
|
+ assert(client.write(String(index))); |
|
|
client.end(); |
|
|
clientSentFIN++; |
|
|
console.error(`No. ${index} client sent FIN, ` + |
|
|
diff --git a/test/parallel/test-net-connect-options-fd.js b/test/parallel/test-net-connect-options-fd.js |
|
|
|
= |
|
--- a/test/parallel/test-net-connect-options-fd.js |
+- |
|
+++ b/test/parallel/test-net-connect-options-fd.js |
|
|
|
= |
|
}) |
+- |
|
.on('error', function(err) { |
|
|
console.error(err); |
|
|
- assert.fail(null, null, '[Pipe server]' + err); |
|
|
+ assert.fail(null, null, `[Pipe server]${err}`); |
|
|
}) |
|
|
.listen({path: serverPath}, common.mustCall(function serverOnListen() { |
|
|
const getSocketOpt = (index) => { |
|
|
const handle = new Pipe(); |
|
|
const err = handle.bind(`${prefix}-client-${socketCounter++}`); |
|
|
- assert(err >= 0, '' + err); |
|
|
+ assert(err >= 0, String(err)); |
|
|
assert.notStrictEqual(handle.fd, -1); |
|
|
handleMap.set(index, handle); |
|
|
console.error(`[Pipe]Bound handle with Pipe ${handle.fd}`); |
|
|
|
= |
|
assert(handleMap.has(index)); |
+- |
|
const oldHandle = handleMap.get(index); |
|
|
assert.strictEqual(oldHandle.fd, this._handle.fd); |
|
|
- client.write(oldHandle.fd + ''); |
|
|
+ client.write(String(oldHandle.fd)); |
|
|
console.error(`[Pipe]Sending data through fd ${oldHandle.fd}`); |
|
|
client.on('error', function(err) { |
|
|
console.error(err); |
|
|
- assert.fail(null, null, '[Pipe Client]' + err); |
|
|
+ assert.fail(null, null, `[Pipe Client]${err}`); |
|
|
}); |
|
|
}); |
|
|
|
= |
|
diff --git a/test/parallel/test-net-connect-options-port.js b/test/parallel/test-net-connect-options-port.js |
+- |
|
|
= |
|
--- a/test/parallel/test-net-connect-options-port.js |
+- |
|
+++ b/test/parallel/test-net-connect-options-port.js |
|
|
|
= |
|
|
|
|
// Total connections = 3 * 4(canConnect) * 6(doConnect) = 72 |
+- |
|
canConnect(port); |
|
|
- canConnect(port + ''); |
|
|
- canConnect('0x' + port.toString(16)); |
|
|
+ canConnect(String(port)); |
|
|
+ canConnect(`0x${port.toString(16)}`); |
|
|
})); |
|
|
|
= |
|
// Try connecting to random ports, but do so once the server is closed |
+- |
|
|
= |
|
function asyncFailToConnect(port) { |
+- |
|
const onError = () => common.mustCall(function(err) { |
|
|
const regexp = /^Error: connect (E\w+)(.+)$/; |
|
|
- assert(regexp.test(err + ''), err + ''); |
|
|
+ assert(regexp.test(String(err)), String(err)); |
|
|
}); |
|
|
|
= |
|
const dont = () => common.mustNotCall(); |
+- |
|
diff --git a/test/parallel/test-net-internal.js b/test/parallel/test-net-internal.js |
= |
diff --git a/test/parallel/test-net-internal.js b/test/parallel/test-net-internal.js |
|
|
|
--- a/test/parallel/test-net-internal.js |
|
--- a/test/parallel/test-net-internal.js |
+++ b/test/parallel/test-net-internal.js |
|
+++ b/test/parallel/test-net-internal.js |
|
|
|
|
|
|
for (let n = 0; n <= 0xFFFF; n++) { |
|
for (let n = 0; n <= 0xFFFF; n++) { |
assert(isLegalPort(n)); |
|
assert(isLegalPort(n)); |
- assert(isLegalPort('' + n)); |
|
- assert(isLegalPort('' + n)); |
+ assert(isLegalPort(String(n))); |
|
+ assert(isLegalPort(String(n))); |
assert(`0x${n.toString(16)}`); |
|
assert(`0x${n.toString(16)}`); |
assert(`0o${n.toString(8)}`); |
|
assert(`0o${n.toString(8)}`); |
assert(`0b${n.toString(2)}`); |
|
assert(`0b${n.toString(2)}`); |
diff --git a/test/parallel/test-net-listen-shared-ports.js b/test/parallel/test-net-listen-shared-ports.js |
+- |
|
|
= |
|
--- a/test/parallel/test-net-listen-shared-ports.js |
+- |
|
+++ b/test/parallel/test-net-listen-shared-ports.js |
|
|
|
= |
|
|
|
|
server1.on('error', function(err) { |
+- |
|
// no errors expected |
|
|
- process.send('server1:' + err.code); |
|
|
+ process.send(`server1:${err.code}`); |
|
|
}); |
|
|
|
= |
|
server2.on('error', function(err) { |
+- |
|
// an error is expected on the second worker |
|
|
- process.send('server2:' + err.code); |
|
|
+ process.send(`server2:${err.code}`); |
|
|
}); |
|
|
|
= |
|
server1.listen({ |
+- |
|
diff --git a/test/parallel/test-net-pipe-connect-errors.js b/test/parallel/test-net-pipe-connect-errors.js |
= |
diff --git a/test/parallel/test-net-pipe-connect-errors.js b/test/parallel/test-net-pipe-connect-errors.js |
|
|
|
--- a/test/parallel/test-net-pipe-connect-errors.js |
|
--- a/test/parallel/test-net-pipe-connect-errors.js |
+++ b/test/parallel/test-net-pipe-connect-errors.js |
|
+++ b/test/parallel/test-net-pipe-connect-errors.js |
|
|
|
// on CI for a POSIX socket. Even though this isn't actually a socket file, |
|
// on CI for a POSIX socket. Even though this isn't actually a socket file, |
// the error will be different from the one we are expecting if we exceed the |
|
// the error will be different from the one we are expecting if we exceed the |
// limit. |
|
// limit. |
- emptyTxt = common.tmpDir + '0.txt'; |
|
- emptyTxt = common.tmpDir + '0.txt'; |
+ emptyTxt = `${common.tmpDir}0.txt`; |
|
+ emptyTxt = `${common.tmpDir}0.txt`; |
|
|
|
function cleanup() { |
|
function cleanup() { |
try { |
|
try { |
diff --git a/test/parallel/test-net-reconnect-error.js b/test/parallel/test-net-reconnect-error.js |
|
diff --git a/test/parallel/test-net-reconnect-error.js b/test/parallel/test-net-reconnect-error.js |
|
|
|
--- a/test/parallel/test-net-reconnect-error.js |
|
--- a/test/parallel/test-net-reconnect-error.js |
+++ b/test/parallel/test-net-reconnect-error.js |
|
+++ b/test/parallel/test-net-reconnect-error.js |
|
|
|
c.on('connect', common.mustNotCall('client should not have connected')); |
<> |
}); |
|
= |
|
c.on('error', function(e) { |
|
c.on('error', function(e) { |
- console.error('CLIENT error: ' + e.code); |
|
- console.error('CLIENT error: ' + e.code); |
+ console.error(`CLIENT error: ${e.code}`); |
|
+ console.error(`CLIENT error: ${e.code}`); |
client_error_count++; |
|
client_error_count++; |
assert.strictEqual('ECONNREFUSED', e.code); |
|
assert.strictEqual('ECONNREFUSED', e.code); |
}); |
|
}); |
diff --git a/test/parallel/test-net-reconnect.js b/test/parallel/test-net-reconnect.js |
|
diff --git a/test/parallel/test-net-reconnect.js b/test/parallel/test-net-reconnect.js |
|
|
|
--- a/test/parallel/test-net-reconnect.js |
|
--- a/test/parallel/test-net-reconnect.js |
|
|
= |
|
if (address1.family === 'IPv6') |
|
if (address1.family === 'IPv6') |
- expectedConnectionKey1 = '6::::' + address1.port; |
|
- expectedConnectionKey1 = '6::::' + address1.port; |
+ expectedConnectionKey1 = `6::::${address1.port}`; |
|
+ expectedConnectionKey1 = `6::::${address1.port}`; |
else |
|
else |
- expectedConnectionKey1 = '4:0.0.0.0:' + address1.port; |
|
- expectedConnectionKey1 = '4:0.0.0.0:' + address1.port; |
+ expectedConnectionKey1 = `4:0.0.0.0:${address1.port}`; |
|
+ expectedConnectionKey1 = `4:0.0.0.0:${address1.port}`; |
|
|
|
assert.strictEqual(connectionKey1, expectedConnectionKey1); |
|
assert.strictEqual(connectionKey1, expectedConnectionKey1); |
assert.strictEqual(common.PORT + 1, address2.port); |
|
assert.strictEqual(common.PORT + 1, address2.port); |
diff --git a/test/parallel/test-net-server-listen-handle.js b/test/parallel/test-net-server-listen-handle.js |
+- |
|
|
= |
|
--- a/test/parallel/test-net-server-listen-handle.js |
+- |
|
+++ b/test/parallel/test-net-server-listen-handle.js |
|
|
|
= |
|
|
|
|
// Avoid conflict with listen-path |
+- |
|
function randomPipePath() { |
|
|
- return common.PIPE + '-listen-handle-' + (counter++); |
|
|
+ return `${common.PIPE}-listen-handle-${counter++}`; |
|
|
} |
|
|
|
= |
|
function randomHandle(type) { |
+- |
|
|
= |
|
net.createServer() |
+- |
|
.listen({fd: fd}, common.mustNotCall()) |
|
|
.on('error', common.mustCall(function(err) { |
|
|
- assert.strictEqual(err + '', 'Error: listen EINVAL'); |
|
|
+ assert.strictEqual(String(err), 'Error: listen EINVAL'); |
|
|
this.close(); |
|
|
})); |
|
|
} |
|
|
diff --git a/test/parallel/test-net-server-listen-path.js b/test/parallel/test-net-server-listen-path.js |
|
|
|
= |
|
--- a/test/parallel/test-net-server-listen-path.js |
+- |
|
+++ b/test/parallel/test-net-server-listen-path.js |
|
|
|
= |
|
|
|
|
// Avoid conflict with listen-handle |
+- |
|
function randomPipePath() { |
|
|
- return common.PIPE + '-listen-path-' + (counter++); |
|
|
+ return `${common.PIPE}-listen-path-${counter++}`; |
|
|
} |
|
|
|
= |
|
// Test listen(path) |
+- |
|
diff --git a/test/parallel/test-net-server-max-connections-close-makes-more-available.js b/test/parallel/test-net-server-max-connections-close-makes-more-available.js |
= |
diff --git a/test/parallel/test-net-server-max-connections-close-makes-more-available.js b/test/parallel/test-net-server-max-connections-close-makes-more-available.js |
|
|
|
--- a/test/parallel/test-net-server-max-connections-close-makes-more-available.js |
|
--- a/test/parallel/test-net-server-max-connections-close-makes-more-available.js |
+++ b/test/parallel/test-net-server-max-connections-close-makes-more-available.js |
|
+++ b/test/parallel/test-net-server-max-connections-close-makes-more-available.js |
|
|
|
const sent = []; |
|
const sent = []; |
|
|
|
function createConnection( |
|
function createConnection( |
- console.error('creating connection ' + |
|
- console.error('creating connection ' + |
+ console.error(`creating connection ${ |
|
+ console.error(`creating connection ${ |
|
} |
= |
} |
|
|
|
function closeConnection( |
|
function closeConnection( |
- console.error('closing connection ' + |
|
- console.error('closing connection ' + |
+ console.error(`closing connection ${ |
|
+ console.error(`closing connection ${ |
return new Promise(function(resolve, reject) { |
|
return new Promise(function(resolve, reject) { |
connections[ |
|
connections[ |
resolve(); |
|
resolve(); |
|
|
|
|
|
|
const server = net.createServer(function(socket) { |
<> |
let server = net.createServer(function(socket) { |
socket.on('data', function(data) { |
= |
socket.on('data', function(data) { |
- console.error('received message: ' + data); |
|
- console.error('received message: ' + data); |
- received.push('' + data); |
|
- received.push('' + data); |
+ console.error(`received message: ${data}`); |
|
+ console.error(`received message: ${data}`); |
+ received.push(String(data)); |
|
+ received.push(String(data)); |
socket.write('acknowledged'); |
|
socket.write('acknowledged'); |
}); |
|
}); |
}); |
|
}); |
diff --git a/test/parallel/test-next-tick-ordering.js b/test/parallel/test-next-tick-ordering.js |
|
diff --git a/test/parallel/test-next-tick-ordering.js b/test/parallel/test-next-tick-ordering.js |
|
|
|
|
|
= |
|
|
|
|
assert.strictEqual(code, 0, `npm install got error code ${code}`); |
|
assert.strictEqual(code, 0, `npm install got error code ${code}`); |
assert.strictEqual(signalCode, null, `unexpected signal: ${signalCode}`); |
|
assert.strictEqual(signalCode, null, `unexpected signal: ${signalCode}`); |
assert.doesNotThrow(function() { |
|
assert.doesNotThrow(function() { |
- fs.accessSync(installDir + '/node_modules/package-name'); |
|
- fs.accessSync(installDir + '/node_modules/package-name'); |
+ fs.accessSync(`${installDir}/node_modules/package-name`); |
|
+ fs.accessSync(`${installDir}/node_modules/package-name`); |
}); |
|
}); |
} |
|
} |
|
|
|
diff --git a/test/parallel/test-openssl-ca-options.js b/test/parallel/test-openssl-ca-options.js |
+- |
|
|
= |
|
--- a/test/parallel/test-openssl-ca-options.js |
+- |
|
+++ b/test/parallel/test-openssl-ca-options.js |
|
|
|
= |
|
'-p', 'process.version'], |
+- |
|
{encoding: 'utf8'}); |
|
|
|
= |
|
-assert.strictEqual(result.stderr, |
+- |
|
- process.execPath + ': either --use-openssl-ca or ' + |
|
|
- '--use-bundled-ca can be used, not both' + os.EOL); |
|
|
+assert.strictEqual(result.stderr, `${process.execPath |
|
|
+ }: either --use-openssl-ca or --use-bundled-ca can be used, not both${os.EOL}` |
|
|
+); |
|
|
assert.strictEqual(result.status, 9); |
|
|
|
= |
|
const useBundledCA = childProcess.spawnSync(process.execPath, [ |
+- |
|
diff --git a/test/parallel/test-os.js b/test/parallel/test-os.js |
= |
diff --git a/test/parallel/test-os.js b/test/parallel/test-os.js |
|
|
|
--- a/test/parallel/test-os.js |
|
--- a/test/parallel/test-os.js |
+++ b/test/parallel/test-os.js |
|
+++ b/test/parallel/test-os.js |
|
|
|
process.env.TEMP = ''; |
|
process.env.TEMP = ''; |
assert.strictEqual(os.tmpdir(), '/tmp'); |
|
assert.strictEqual(os.tmpdir(), '/tmp'); |
process.env.TMP = ''; |
|
process.env.TMP = ''; |
- const expected = (process.env.SystemRoot || process.env.windir) + '\\temp'; |
|
- const expected = (process.env.SystemRoot || process.env.windir) + '\\temp'; |
+ const expected = `${process.env.SystemRoot || process.env.windir}\\temp`; |
|
+ const expected = `${process.env.SystemRoot || process.env.windir}\\temp`; |
|
}); |
= |
}); |
return option; |
|
return option; |
}; |
|
}; |
|
|
|
const fixtureThrows = fixture('throws_error4.js'); |
|
const fixtureThrows = fixture('throws_error4.js'); |
|
|
|
// test preloading a single module works |
|
// test preloading a single module works |
-childProcess.exec(nodeBinary + ' ' + preloadOption([fixtureA]) + ' ' + fixtureB, |
|
-childProcess.exec(nodeBinary + ' ' + preloadOption([fixtureA]) + ' ' + fixtureB, |
+childProcess.exec(`${nodeBinary} ${preloadOption([fixtureA])} ${fixtureB}`, |
|
+childProcess.exec(`${nodeBinary} ${preloadOption([fixtureA])} ${fixtureB}`, |
function(err, stdout, stderr) { |
|
function(err, stdout, stderr) { |
assert.ifError(err); |
<> |
if (err) throw err; |
assert.strictEqual(stdout, 'A\nB\n'); |
= |
assert.strictEqual(stdout, 'A\nB\n'); |
|
|
|
|
|
|
// test preloading multiple modules works |
|
// test preloading multiple modules works |
childProcess.exec( |
|
childProcess.exec( |
- nodeBinary + ' ' + preloadOption([fixtureA, fixtureB]) + ' ' + fixtureC, |
|
- nodeBinary + ' ' + preloadOption([fixtureA, fixtureB]) + ' ' + fixtureC, |
+ `${nodeBinary} ${preloadOption([fixtureA, fixtureB])} ${fixtureC}`, |
|
+ `${nodeBinary} ${preloadOption([fixtureA, fixtureB])} ${fixtureC}`, |
function(err, stdout, stderr) { |
|
function(err, stdout, stderr) { |
assert.ifError(err); |
<> |
if (err) throw err; |
assert.strictEqual(stdout, 'A\nB\nC\n'); |
= |
assert.strictEqual(stdout, 'A\nB\nC\n'); |
|
|
|
|
|
|
// test that preloading a throwing module aborts |
|
// test that preloading a throwing module aborts |
childProcess.exec( |
|
childProcess.exec( |
- nodeBinary + ' ' + preloadOption([fixtureA, fixtureThrows]) + ' ' + fixtureB, |
|
- nodeBinary + ' ' + preloadOption([fixtureA, fixtureThrows]) + ' ' + fixtureB, |
+ `${nodeBinary} ${preloadOption([fixtureA, fixtureThrows])} ${fixtureB}`, |
|
+ `${nodeBinary} ${preloadOption([fixtureA, fixtureThrows])} ${fixtureB}`, |
function(err, stdout, stderr) { |
|
function(err, stdout, stderr) { |
if (err) { |
|
if (err) { |
assert.strictEqual(stdout, 'A\n'); |
|
assert.strictEqual(stdout, 'A\n'); |
|
|
|
|
|
|
// test that preload can be used with --eval |
|
// test that preload can be used with --eval |
childProcess.exec( |
|
childProcess.exec( |
- nodeBinary + ' ' + preloadOption([fixtureA]) + '-e "console.log(\'hello\');"', |
|
- nodeBinary + ' ' + preloadOption([fixtureA]) + '-e "console.log(\'hello\');"', |
+ `${nodeBinary} ${preloadOption([fixtureA])}-e "console.log('hello');"`, |
|
+ `${nodeBinary} ${preloadOption([fixtureA])}-e "console.log('hello');"`, |
function(err, stdout, stderr) { |
|
function(err, stdout, stderr) { |
assert.ifError(err); |
<> |
if (err) throw err; |
assert.strictEqual(stdout, 'A\nhello\n'); |
= |
assert.strictEqual(stdout, 'A\nhello\n'); |
|
|
|
// test that preload placement at other points in the cmdline |
|
// test that preload placement at other points in the cmdline |
// also test that duplicated preload only gets loaded once |
|
// also test that duplicated preload only gets loaded once |
childProcess.exec( |
|
childProcess.exec( |
- nodeBinary + ' ' + preloadOption([fixtureA]) + |
|
- nodeBinary + ' ' + preloadOption([fixtureA]) + |
- '-e "console.log(\'hello\');" ' + preloadOption([fixtureA, fixtureB]), |
|
- '-e "console.log(\'hello\');" ' + preloadOption([fixtureA, fixtureB]), |
+ `${nodeBinary} ${preloadOption([fixtureA])}-e "console.log('hello');" ${ |
|
+ `${nodeBinary} ${preloadOption([fixtureA])}-e "console.log('hello');" ${ |
+ preloadOption([fixtureA, fixtureB])}`, |
|
+ preloadOption([fixtureA, fixtureB])}`, |
function(err, stdout, stderr) { |
|
function(err, stdout, stderr) { |
assert.ifError(err); |
<> |
if (err) throw err; |
assert.strictEqual(stdout, 'A\nB\nhello\n'); |
= |
assert.strictEqual(stdout, 'A\nB\nhello\n'); |
|
|
|
|
|
|
// test that preload works with -i |
|
// test that preload works with -i |
const interactive = childProcess.exec( |
|
const interactive = childProcess.exec( |
- nodeBinary + ' ' + preloadOption([fixtureD]) + '-i', |
|
- nodeBinary + ' ' + preloadOption([fixtureD]) + '-i', |
+ `${nodeBinary} ${preloadOption([fixtureD])}-i`, |
|
+ `${nodeBinary} ${preloadOption([fixtureD])}-i`, |
common.mustCall(function(err, stdout, stderr) { |
|
common.mustCall(function(err, stdout, stderr) { |
assert.ifError(err); |
|
assert.ifError(err); |
assert.strictEqual(stdout, "> 'test'\n> "); |
|
assert.strictEqual(stdout, "> 'test'\n> "); |
|
|
|
interactive.stdin.write('process.exit()\n'); |
|
interactive.stdin.write('process.exit()\n'); |
|
|
|
childProcess.exec( |
|
childProcess.exec( |
- `${nodeBinary} --require ${fixture('cluster-preload.js')} ` + |
|
- `${nodeBinary} --require ${fixture('cluster-preload.js')} ` + |
- fixture('cluster-preload-test.js'), |
|
- fixture('cluster-preload-test.js'), |
+ `${nodeBinary} --require ${fixture('cluster-preload.js')} ${ |
|
+ `${nodeBinary} --require ${fixture('cluster-preload.js')} ${ |
+ fixture('cluster-preload-test.js')}`, |
|
+ fixture('cluster-preload-test.js')}`, |
function(err, stdout, stderr) { |
|
function(err, stdout, stderr) { |
assert.ifError(err); |
<> |
if (err) throw err; |
assert.ok(/worker terminated with code 43/.test(stdout)); |
= |
assert.ok(/worker terminated with code 43/.test(stdout)); |
diff --git a/test/parallel/test-process-exit-code.js b/test/parallel/test-process-exit-code.js |
|
diff --git a/test/parallel/test-process-exit-code.js b/test/parallel/test-process-exit-code.js |
|
|
|
--- a/test/parallel/test-process-exit-code.js |
|
--- a/test/parallel/test-process-exit-code.js |
+++ b/test/parallel/test-process-exit-code.js |
|
+++ b/test/parallel/test-process-exit-code.js |
|
|
|
const f = __filename; |
|
const f = __filename; |
const option = { stdio: [ 0, 1, 'ignore' ] }; |
|
const option = { stdio: [ 0, 1, 'ignore' ] }; |
spawn(node, [f, arg], option).on('exit', function(code) { |
|
spawn(node, [f, arg], option).on('exit', function(code) { |
- assert.strictEqual(code, exit, 'wrong exit for ' + |
|
- assert.strictEqual(code, exit, 'wrong exit for ' + |
|
function parent() { |
= |
function parent() { |
|
|
|
child.stderr.setEncoding('utf8'); |
|
child.stderr.setEncoding('utf8'); |
|
|
|
child.stderr.on('end', function() { |
|
child.stderr.on('end', function() { |
- assert.strictEqual(output, 'I can still debug!' + os.EOL); |
|
- assert.strictEqual(output, 'I can still debug!' + os.EOL); |
+ assert.strictEqual(output, `I can still debug!${os.EOL}`); |
|
+ assert.strictEqual(output, `I can still debug!${os.EOL}`); |
console.log('ok - got expected message'); |
|
console.log('ok - got expected message'); |
}); |
|
}); |
|
|
|
diff --git a/test/parallel/test-process-redirect-warnings-env.js b/test/parallel/test-process-redirect-warnings-env.js |
+- |
|
|
= |
|
--- a/test/parallel/test-process-redirect-warnings-env.js |
+- |
|
+++ b/test/parallel/test-process-redirect-warnings-env.js |
|
|
|
= |
|
|
|
|
common.refreshTmpDir(); |
+- |
|
|
= |
|
-const warnmod = require.resolve(common.fixturesDir + '/warnings.js'); |
+- |
|
+const warnmod = require.resolve(`${common.fixturesDir}/warnings.js`); |
|
|
const warnpath = path.join(common.tmpDir, 'warnings.txt'); |
|
|
|
= |
|
fork(warnmod, {env: {NODE_REDIRECT_WARNINGS: warnpath}}) |
+- |
|
diff --git a/test/parallel/test-process-redirect-warnings.js b/test/parallel/test-process-redirect-warnings.js |
|
|
|
= |
|
--- a/test/parallel/test-process-redirect-warnings.js |
+- |
|
+++ b/test/parallel/test-process-redirect-warnings.js |
|
|
|
= |
|
|
|
|
common.refreshTmpDir(); |
+- |
|
|
= |
|
-const warnmod = require.resolve(common.fixturesDir + '/warnings.js'); |
+- |
|
+const warnmod = require.resolve(`${common.fixturesDir}/warnings.js`); |
|
|
const warnpath = path.join(common.tmpDir, 'warnings.txt'); |
|
|
|
= |
|
fork(warnmod, {execArgv: [`--redirect-warnings=${warnpath}`]}) |
+- |
|
diff --git a/test/parallel/test-promises-unhandled-rejections.js b/test/parallel/test-promises-unhandled-rejections.js |
= |
diff --git a/test/parallel/test-promises-unhandled-rejections.js b/test/parallel/test-promises-unhandled-rejections.js |
|
|
|
--- a/test/parallel/test-promises-unhandled-rejections.js |
|
--- a/test/parallel/test-promises-unhandled-rejections.js |
+++ b/test/parallel/test-promises-unhandled-rejections.js |
|
+++ b/test/parallel/test-promises-unhandled-rejections.js |
|
|
|
|
|
|
function fail(error) { |
|
function fail(error) { |
const stack = currentTest ? |
<> |
const stack = currentTest |
- error.stack + '\nFrom previous event:\n' + currentTest.stack : |
|
- ? error.stack + '\nFrom previous event:\n' + currentTest.stack |
+ `${error.stack}\nFrom previous event:\n${currentTest.stack}` : |
|
+ ? `${error.stack}\nFrom previous event:\n${currentTest.stack}` |
error.stack; |
|
: error.stack; |
|
= |
|
if (currentTest) |
|
if (currentTest) |
- process.stderr.write('\'' + currentTest.description + '\' failed\n\n'); |
|
- process.stderr.write('\'' + currentTest.description + '\' failed\n\n'); |
+ process.stderr.write(`'${currentTest.description}' failed\n\n`); |
|
+ process.stderr.write(`'${currentTest.description}' failed\n\n`); |
|
|
|
process.stderr.write(stack); |
|
process.stderr.write(stack); |
process.exit(2); |
|
process.exit(2); |
diff --git a/test/parallel/test-querystring-maxKeys-non-finite.js b/test/parallel/test-querystring-maxKeys-non-finite.js |
|
diff --git a/test/parallel/test-querystring-maxKeys-non-finite.js b/test/parallel/test-querystring-maxKeys-non-finite.js |
|
|
|
--- a/test/parallel/test-querystring-maxKeys-non-finite.js |
|
--- a/test/parallel/test-querystring-maxKeys-non-finite.js |
|
}, |
= |
}, |
{ |
|
{ |
env: { NODE_REPL_HISTORY_FILE: oldHistoryPath, |
|
env: { NODE_REPL_HISTORY_FILE: oldHistoryPath, |
NODE_REPL_HISTORY_SIZE: 1 }, |
|
NODE_REPL_HISTORY_SIZE: 1 }, |
test: [UP, UP, UP, CLEAR], |
|
test: [UP, UP, UP, CLEAR], |
- expected: [prompt, convertMsg, prompt, prompt + '\'=^.^=\'', prompt] |
|
- expected: [prompt, convertMsg, prompt, prompt + '\'=^.^=\'', prompt] |
+ expected: [prompt, convertMsg, prompt, `${prompt}'=^.^='`, prompt] |
|
+ expected: [prompt, convertMsg, prompt, `${prompt}'=^.^='`, prompt] |
}, |
|
}, |
{ |
|
{ |
env: { NODE_REPL_HISTORY: historyPathFail, |
|
env: { NODE_REPL_HISTORY: historyPathFail, |
diff --git a/test/parallel/test-repl-save-load.js b/test/parallel/test-repl-save-load.js |
+- |
|
|
= |
|
--- a/test/parallel/test-repl-save-load.js |
+- |
|
+++ b/test/parallel/test-repl-save-load.js |
|
|
|
= |
|
putIn.run(testFile); |
+- |
|
|
= |
|
// save it to a file |
+- |
|
-putIn.run(['.save ' + saveFileName]); |
|
|
+putIn.run([`.save ${saveFileName}`]); |
|
|
|
= |
|
// the file should have what I wrote |
+- |
|
-assert.strictEqual(fs.readFileSync(saveFileName, 'utf8'), testFile.join('\n') + |
|
|
- '\n'); |
|
|
+assert.strictEqual(fs.readFileSync(saveFileName, 'utf8'), |
|
|
+ `${testFile.join('\n')}\n`); |
|
|
|
= |
|
{ |
+- |
|
// save .editor mode code |
|
|
|
= |
|
putIn.run(['.clear']); |
+- |
|
|
= |
|
// Load the file back in |
+- |
|
-putIn.run(['.load ' + saveFileName]); |
|
|
+putIn.run([`.load ${saveFileName}`]); |
|
|
|
= |
|
// make sure that the REPL data is "correct" |
+- |
|
testMe.complete('inner.o', function(error, data) { |
|
|
|
= |
|
// should not break |
+- |
|
putIn.write = function(data) { |
|
|
// make sure I get a failed to load message and not some crazy error |
|
|
- assert.strictEqual(data, 'Failed to load:' + loadFile + '\n'); |
|
|
+ assert.strictEqual(data, `Failed to load:${loadFile}\n`); |
|
|
// eat me to avoid work |
|
|
putIn.write = common.noop; |
|
|
}; |
|
|
-putIn.run(['.load ' + loadFile]); |
|
|
+putIn.run([`.load ${loadFile}`]); |
|
|
|
= |
|
// throw error on loading directory |
+- |
|
loadFile = common.tmpDir; |
|
|
putIn.write = function(data) { |
|
|
- assert.strictEqual(data, 'Failed to load:' + loadFile + |
|
|
- ' is not a valid file\n'); |
|
|
+ assert.strictEqual(data, `Failed to load:${loadFile} is not a valid file\n`); |
|
|
putIn.write = common.noop; |
|
|
}; |
|
|
-putIn.run(['.load ' + loadFile]); |
|
|
+putIn.run([`.load ${loadFile}`]); |
|
|
|
= |
|
// clear the REPL |
+- |
|
putIn.run(['.clear']); |
|
|
|
= |
|
// should not break |
+- |
|
putIn.write = function(data) { |
|
|
// make sure I get a failed to save message and not some other error |
|
|
- assert.strictEqual(data, 'Failed to save:' + invalidFileName + '\n'); |
|
|
+ assert.strictEqual(data, `Failed to save:${invalidFileName}\n`); |
|
|
// reset to no-op |
|
|
putIn.write = common.noop; |
|
|
}; |
|
|
|
= |
|
// save it to a file |
+- |
|
-putIn.run(['.save ' + invalidFileName]); |
|
|
+putIn.run([`.save ${invalidFileName}`]); |
|
|
diff --git a/test/parallel/test-repl-tab-complete.js b/test/parallel/test-repl-tab-complete.js |
= |
diff --git a/test/parallel/test-repl-tab-complete.js b/test/parallel/test-repl-tab-complete.js |
|
|
|
--- a/test/parallel/test-repl-tab-complete.js |
|
--- a/test/parallel/test-repl-tab-complete.js |
+++ b/test/parallel/test-repl-tab-complete.js |
|
+++ b/test/parallel/test-repl-tab-complete.js |
|
|
|
testMe.complete('require(\'', common.mustCall(function(error, data) { |
|
testMe.complete('require(\'', common.mustCall(function(error, data) { |
assert.strictEqual(error, null); |
|
assert.strictEqual(error, null); |
repl._builtinLibs.forEach(function(lib) { |
|
repl._builtinLibs.forEach(function(lib) { |
- assert.notStrictEqual(data[0]. |
|
- assert.notStrictEqual(data[0]. |
+ assert.notStrictEqual(data[0]. |
|
+ assert.notStrictEqual(data[0]. |
|
{ |
= |
{ |
client: client_unix, send: '(function() {\nreturn /foo/ / /bar/;\n}())', |
|
client: client_unix, send: '(function() {\nreturn /foo/ / /bar/;\n}())', |
- expect: prompt_multiline + prompt_multiline + 'NaN\n' + prompt_unix |
|
- expect: prompt_multiline + prompt_multiline + 'NaN\n' + prompt_unix |
+ expect: `${prompt_multiline}${prompt_multiline}NaN\n${prompt_unix}` |
|
+ expect: `${prompt_multiline}${prompt_multiline}NaN\n${prompt_unix}` |
}, |
|
}, |
|
|
|
{ |
|
{ |
client: client_unix, send: '(function() {\nif (false) {} /bar"/;\n}())', |
|
client: client_unix, send: '(function() {\nif (false) {} /bar"/;\n}())', |
- expect: prompt_multiline + prompt_multiline + 'undefined\n' + prompt_unix |
|
- expect: prompt_multiline + prompt_multiline + 'undefined\n' + prompt_unix |
+ expect: `${prompt_multiline}${prompt_multiline}undefined\n${prompt_unix}` |
|
+ expect: `${prompt_multiline}${prompt_multiline}undefined\n${prompt_unix}` |
}, |
<> |
} |
|
|
]); |
|
|
} |
// Newline within template string maintains whitespace. |
|
|
{ client: client_unix, send: '`foo \n`', |
|
|
- expect: prompt_multiline + '\'foo \\n\'\n' + prompt_unix }, |
|
|
+ expect: `${prompt_multiline}'foo \\n'\n${prompt_unix}` }, |
|
|
// Whitespace is not evaluated. |
|
|
{ client: client_unix, send: ' \t \n', |
|
|
expect: prompt_unix } |
|
|
|
= |
|
{ client: client_tcp, send: 'a += 1', |
|
{ client: client_tcp, send: 'a += 1', |
expect: (`12346\n${prompt_tcp}`) }, |
|
expect: (`12346\n${prompt_tcp}`) }, |
{ client: client_tcp, |
|
{ client: client_tcp, |
- send: 'require(' + JSON.stringify(moduleFilename) + ').number', |
|
- send: 'require(' + JSON.stringify(moduleFilename) + ').number', |
+ send: `require(${JSON.stringify(moduleFilename)}).number`, |
|
+ send: `require(${JSON.stringify(moduleFilename)}).number`, |
expect: (`42\n${prompt_tcp}`) } |
|
expect: (`42\n${prompt_tcp}`) } |
]); |
|
]); |
}); |
|
}); |
|
|
|
|
|
= |
|
--- a/test/parallel/test-signal-handler.js |
|
--- a/test/parallel/test-signal-handler.js |
+++ b/test/parallel/test-signal-handler.js |
|
+++ b/test/parallel/test-signal-handler.js |
|
|
|
return; |
|
return; |
} |
|
} |
|
|
|
-console.log('process.pid: ' + process.pid); |
|
-console.log('process.pid: ' + process.pid); |
+console.log(`process.pid: ${process.pid}`); |
|
+console.log(`process.pid: ${process.pid}`); |
|
|
|
process.on('SIGUSR1', common.mustCall()); |
<> |
process.on('SIGUSR1', common.mustCall(function() {})); |
|
= |
|
|
|
|
|
|
|
let i = 0; |
|
let i = 0; |
setInterval(function() { |
|
setInterval(function() { |
- console.log('running process...' + ++i); |
|
- console.log('running process...' + ++i); |
+ console.log(`running process...${++i}`); |
|
+ console.log(`running process...${++i}`); |
|
|
|
if (i === 5) { |
|
if (i === 5) { |
process.kill(process.pid, 'SIGUSR1'); |
|
process.kill(process.pid, 'SIGUSR1'); |
|
+++ b/test/parallel/test-stream-base-no-abort.js |
= |
+++ b/test/parallel/test-stream-base-no-abort.js |
|
|
|
|
|
|
const checkTLS = common.mustCall(function checkTLS() { |
|
const checkTLS = common.mustCall(function checkTLS() { |
const options = { |
|
const options = { |
- key: fs.readFileSync(common.fixturesDir + '/keys/ec-key.pem'), |
|
- key: fs.readFileSync(common.fixturesDir + '/keys/ec-key.pem'), |
- cert: fs.readFileSync(common.fixturesDir + '/keys/ec-cert.pem') |
|
- cert: fs.readFileSync(common.fixturesDir + '/keys/ec-cert.pem') |
+ key: fs.readFileSync(`${common.fixturesDir}/keys/ec-key.pem`), |
|
+ key: fs.readFileSync(`${common.fixturesDir}/keys/ec-key.pem`), |
+ cert: fs.readFileSync(`${common.fixturesDir}/keys/ec-cert.pem`) |
|
+ cert: fs.readFileSync(`${common.fixturesDir}/keys/ec-cert.pem`) |
}; |
|
}; |
const server = tls.createServer(options, common.noop) |
<> |
const server = tls.createServer(options, () => {}) |
.listen(0, function() { |
= |
.listen(0, function() { |
diff --git a/test/parallel/test-stream-push-strings.js b/test/parallel/test-stream-push-strings.js |
|
diff --git a/test/parallel/test-stream-push-strings.js b/test/parallel/test-stream-push-strings.js |
|
|
|
--- a/test/parallel/test-stream-push-strings.js |
|
--- a/test/parallel/test-stream-push-strings.js |
+++ b/test/parallel/test-stream-push-strings.js |
|
+++ b/test/parallel/test-stream-push-strings.js |
|
|
|
ms.on('readable', function() { |
|
ms.on('readable', function() { |
let chunk; |
|
let chunk; |
while (null !== (chunk = ms.read())) |
|
while (null !== (chunk = ms.read())) |
- results.push(chunk + ''); |
|
- results.push(chunk + ''); |
|
|
= |
|
const fs = require('fs'); |
|
const fs = require('fs'); |
|
|
|
const server = tls.createServer({ |
|
const server = tls.createServer({ |
- key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), |
|
- key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), |
- cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem') |
|
- cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem') |
+ key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), |
|
+ key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), |
+ cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`) |
|
+ cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`) |
}, function(c) { |
|
}, function(c) { |
}).listen(0, common.mustCall(function() { |
|
}).listen(0, common.mustCall(function() { |
const c = tls.connect(this.address().port, common.mustNotCall()); |
<> |
const c = tls.connect(this.address().port, function() { |
diff --git a/test/parallel/test-tls-close-notify.js b/test/parallel/test-tls-close-notify.js |
= |
diff --git a/test/parallel/test-tls-close-notify.js b/test/parallel/test-tls-close-notify.js |
|
|
|
--- a/test/parallel/test-tls-close-notify.js |
|
--- a/test/parallel/test-tls-close-notify.js |
+++ b/test/parallel/test-tls-close-notify.js |
|
+++ b/test/parallel/test-tls-close-notify.js |
|
|
|
const fs = require('fs'); |
|
const fs = require('fs'); |
|
|
|
const server = tls.createServer({ |
|
const server = tls.createServer({ |
- key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), |
|
- key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), |
- cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem') |
|
- cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem') |
|
diff --git a/test/parallel/test-tls-two-cas-one-string.js b/test/parallel/test-tls-two-cas-one-string.js |
= |
diff --git a/test/parallel/test-tls-two-cas-one-string.js b/test/parallel/test-tls-two-cas-one-string.js |
|
|
|
--- a/test/parallel/test-tls-two-cas-one-string.js |
|
--- a/test/parallel/test-tls-two-cas-one-string.js |
+++ b/test/parallel/test-tls-two-cas-one-string.js |
|
+++ b/test/parallel/test-tls-two-cas-one-string.js |
|
|
|
} |
|
} |
|
|
|
const array = [ca1, ca2]; |
|
const array = [ca1, ca2]; |
-const string = ca1 + '\n' + ca2; |
|
-const string = ca1 + '\n' + ca2; |
+const string = `${ca1}\n${ca2}`; |
|
+const string = `${ca1}\n${ca2}`; |
test(array, () => test(string, common.noop)); |
<> |
test(array, () => test(string, () => {})); |
diff --git a/test/parallel/test-tls-wrap-timeout.js b/test/parallel/test-tls-wrap-timeout.js |
= |
diff --git a/test/parallel/test-tls-wrap-timeout.js b/test/parallel/test-tls-wrap-timeout.js |
|
|
|
--- a/test/parallel/test-tls-wrap-timeout.js |
|
--- a/test/parallel/test-tls-wrap-timeout.js |
+++ b/test/parallel/test-tls-wrap-timeout.js |
|
+++ b/test/parallel/test-tls-wrap-timeout.js |
|
|
|
const fs = require('fs'); |
|
const fs = require('fs'); |
|
|
|
const options = { |
|
const options = { |
- key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), |
|
- key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), |
- cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem') |
|
- cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem') |
+ key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), |
|
+ key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), |
+ cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`) |
|
+ cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`) |
}; |
|
}; |
|
|
|
const server = tls.createServer(options, common.mustCall((c) => { |
|
const server = tls.createServer(options, common.mustCall((c) => { |
diff --git a/test/parallel/test-url-format.js b/test/parallel/test-url-format.js |
+- |
|
|
= |
|
--- a/test/parallel/test-url-format.js |
+- |
|
+++ b/test/parallel/test-url-format.js |
|
|
|
= |
|
const actual = url.format(u); |
+- |
|
const actualObj = url.format(formatTests[u]); |
|
|
assert.strictEqual(actual, expect, |
|
|
- 'wonky format(' + u + ') == ' + expect + |
|
|
- '\nactual:' + actual); |
|
|
+ `wonky format(${u}) == ${expect}\nactual:${actual}`); |
|
|
assert.strictEqual(actualObj, expect, |
|
|
- 'wonky format(' + JSON.stringify(formatTests[u]) + |
|
|
- ') == ' + expect + |
|
|
- '\nactual: ' + actualObj); |
|
|
+ `wonky format(${JSON.stringify(formatTests[u])}) == ${ |
|
|
+ expect}\nactual: ${actualObj}`); |
|
|
} |
|
|
diff --git a/test/parallel/test-url-parse-format.js b/test/parallel/test-url-parse-format.js |
|
|
|
= |
|
--- a/test/parallel/test-url-parse-format.js |
+- |
|
+++ b/test/parallel/test-url-parse-format.js |
|
|
|
= |
|
actual = url.format(parseTests[u]); |
+- |
|
|
= |
|
assert.strictEqual(actual, expected, |
+- |
|
- 'format(' + u + ') == ' + u + '\nactual:' + actual); |
|
|
+ `format(${u}) == ${u}\nactual:${actual}`); |
|
|
} |
|
|
diff --git a/test/parallel/test-util-inspect.js b/test/parallel/test-util-inspect.js |
= |
diff --git a/test/parallel/test-util-inspect.js b/test/parallel/test-util-inspect.js |
|
|
|
--- a/test/parallel/test-util-inspect.js |
|
--- a/test/parallel/test-util-inspect.js |
+++ b/test/parallel/test-util-inspect.js |
|
+++ b/test/parallel/test-util-inspect.js |
|
|
|
|
|
|
const withoutColor = util.inspect(input, false, 0, false); |
<> |
const without_color = util.inspect(input, false, 0, false); |
const withColor = util.inspect(input, false, 0, true); |
|
const with_color = util.inspect(input, false, 0, true); |
- const expect = '\u001b[' + color[0] + 'm' + withoutColor + |
|
- const expect = '\u001b[' + color[0] + 'm' + without_color + |
- '\u001b[' + color[1] + 'm'; |
= |
- '\u001b[' + color[1] + 'm'; |
+ const expect = `\u001b[${color[0]}m${withoutColor}\u001b[${color[1]}m`; |
<> |
+ const expect = `\u001b[${color[0]}m${without_color}\u001b[${color[1]}m`; |
assert.strictEqual( |
= |
assert.strictEqual( |
withColor, |
<> |
with_color, |
expect, |
= |
expect, |
diff --git a/test/parallel/test-vm-cached-data.js b/test/parallel/test-vm-cached-data.js |
|
diff --git a/test/parallel/test-vm-cached-data.js b/test/parallel/test-vm-cached-data.js |
|
|
|
--- a/test/parallel/test-vm-cached-data.js |
|
--- a/test/parallel/test-vm-cached-data.js |
+++ b/test/parallel/test-vm-cached-data.js |
|
+++ b/test/parallel/test-vm-cached-data.js |
|
|
|
console.log(data); |
|
console.log(data); |
`, source]); |
|
`, source]); |
|
|
|
- assert.strictEqual(out.status, 0, out.stderr + ''); |
|
- assert.strictEqual(out.status, 0, out.stderr + ''); |
|
const data = []; |
= |
const data = []; |
proc.stdout.on('data', common.mustNotCall()); |
|
proc.stdout.on('data', common.mustNotCall()); |
diff --git a/test/parallel/test-vm-syntax-error-stderr.js b/test/parallel/test-vm-syntax-error-stderr.js |
|
diff --git a/test/parallel/test-vm-syntax-error-stderr.js b/test/parallel/test-vm-syntax-error-stderr.js |
|
|
|
--- a/test/parallel/test-vm-syntax-error-stderr.js |
|
--- a/test/parallel/test-vm-syntax-error-stderr.js |
+++ b/test/parallel/test-vm-syntax-error-stderr.js |
|
+++ b/test/parallel/test-vm-syntax-error-stderr.js |
|
|
|
]); |
|
]); |
|
|
|
p.stdout.on('data', function(data) { |
|
p.stdout.on('data', function(data) { |
- assert.fail('Unexpected stdout data: ' + data); |
<> |
- common.fail('Unexpected stdout data: ' + data); |
+ assert.fail(`Unexpected stdout data: ${data}`); |
|
+ common.fail(`Unexpected stdout data: ${data}`); |
}); |
= |
}); |
|
|
|
let output = ''; |
|
let output = ''; |
diff --git a/test/parallel/test-zlib-convenience-methods.js b/test/parallel/test-zlib-convenience-methods.js |
|
diff --git a/test/parallel/test-zlib-convenience-methods.js b/test/parallel/test-zlib-convenience-methods.js |
|
|
|
--- a/test/parallel/test-zlib-convenience-methods.js |
|
--- a/test/parallel/test-zlib-convenience-methods.js |
+++ b/test/parallel/test-zlib-convenience-methods.js |
|
+++ b/test/parallel/test-zlib-convenience-methods.js |
|
|
|
|
<> |
zlib[method[0]](expect, opts, function(err, result) { |
|
|
zlib[method[1]](result, opts, function(err, result) { |
|
|
assert.strictEqual(result.toString(), expect, |
|
|
- 'Should get original string after ' + |
|
|
- method[0] + '/' + method[1] + ' with options.'); |
|
|
+ `Should get original string after ${ |
|
|
+ method[0]}/${method[1]} with options.`); |
|
|
hadRun++; |
})); |
|
}); |
|
|
}); |
|
= |
|
|
-+ |
zlib[method[0]](expect, function(err, result) { |
|
|
zlib[method[1]](result, function(err, result) { |
|
|
assert.strictEqual(result.toString(), expect, |
|
|
- 'Should get original string after ' + |
|
|
- method[0] + '/' + method[1] + ' without options.'); |
|
|
+ `Should get original string after ${ |
|
|
+ method[0]}/${method[1]} without options.`); |
|
|
hadRun++; |
|
|
}); |
|
|
}); |
|
= |
|
{ |
<> |
|
- const compressed = zlib[method[0] + 'Sync'](expect, opts); |
|
- let result = zlib[method[0] + 'Sync'](expect, opts); |
- const decompressed = zlib[method[1] + 'Sync'](compressed, opts); |
|
- result = zlib[method[1] + 'Sync'](result, opts); |
+ const compressed = zlib[`${method[0]}Sync`](expect, opts); |
|
+ let result = zlib[`${method[0]}Sync`](expect, opts); |
+ const decompressed = zlib[`${method[1]}Sync`](compressed, opts); |
|
+ result = zlib[`${method[1]}Sync`](result, opts); |
assert.strictEqual(decompressed.toString(), expectStr, |
|
assert.strictEqual(result.toString(), expect, |
|
|
- 'Should get original string after ' + |
|
|
- method[0] + '/' + method[1] + ' with options.'); |
`Should get original string after ${method[0]}Sync/` + |
|
+ `Should get original string after ${ |
`${method[1]}Sync ${type} with options.`); |
|
+ method[0]}/${method[1]} with options.`); |
@@ -75,8 +75,8 @@ for (const [type, expect] of [ |
|
hadRun++; |
|
= |
|
|
|
|
{ |
<> |
|
- const compressed = zlib[method[0] + 'Sync'](expect); |
|
- result = zlib[method[0] + 'Sync'](expect); |
- const decompressed = zlib[method[1] + 'Sync'](compressed); |
|
- result = zlib[method[1] + 'Sync'](result); |
+ const compressed = zlib[`${method[0]}Sync`](expect); |
|
+ result = zlib[`${method[0]}Sync`](expect); |
+ const decompressed = zlib[`${method[1]}Sync`](compressed); |
|
+ result = zlib[`${method[1]}Sync`](result); |
assert.strictEqual(decompressed.toString(), expectStr, |
|
assert.strictEqual(result.toString(), expect, |
|
|
- 'Should get original string after ' + |
|
|
- method[0] + '/' + method[1] + ' without options.'); |
`Should get original string after ${method[0]}Sync/` + |
|
+ `Should get original string after ${ |
`${method[1]}Sync ${type} without options.`); |
|
+ method[0]}/${method[1]} without options.`); |
diff --git a/test/parallel/test-zlib-deflate-constructors.js b/test/parallel/test-zlib-deflate-constructors.js |
|
hadRun++; |
|
= |
|
--- a/test/parallel/test-zlib-deflate-constructors.js |
+- |
|
+++ b/test/parallel/test-zlib-deflate-constructors.js |
|
|
|
= |
|
|
|
|
// Throws if opt.strategy is the wrong type. |
<> |
|
assert.throws( |
|
|
- () => { new zlib.Deflate({strategy: '' + zlib.constants.Z_RLE }); }, |
|
|
+ () => { new zlib.Deflate({ strategy: String(zlib.constants.Z_RLE) }); }, |
|
|
/^TypeError: Invalid strategy: 3$/ |
|
|
); |
|
}); |
|
= |
|
diff --git a/test/parallel/test-zlib-from-gzip.js b/test/parallel/test-zlib-from-gzip.js |
|
diff --git a/test/parallel/test-zlib-from-gzip.js b/test/parallel/test-zlib-from-gzip.js |
|
|
|
--- a/test/parallel/test-zlib-from-gzip.js |
|
--- a/test/parallel/test-zlib-from-gzip.js |
+++ b/test/parallel/test-zlib-from-gzip.js |
|
+++ b/test/parallel/test-zlib-from-gzip.js |
|
|
|
const actual = fs.readFileSync(outputFile); |
|
const actual = fs.readFileSync(outputFile); |
assert.strictEqual(actual.length, expect.length, 'length should match'); |
|
assert.strictEqual(actual.length, expect.length, 'length should match'); |
for (let i = 0, l = actual.length; i < l; i++) { |
|
for (let i = 0, l = actual.length; i < l; i++) { |
- assert.strictEqual(actual[i], expect[i], 'byte[' + i + ']'); |
|
- assert.strictEqual(actual[i], expect[i], 'byte[' + i + ']'); |
|
// 1000 bytes wrapped at 50 columns |
= |
// 1000 bytes wrapped at 50 columns |
// \n turns into a double-byte character |
|
// \n turns into a double-byte character |
// (48 + {2}) * 20 = 1000 |
|
// (48 + {2}) * 20 = 1000 |
-let out = ('o'.repeat(48) + '\n').repeat(20); |
|
-let out = ('o'.repeat(48) + '\n').repeat(20); |
+let out = `${'o'.repeat(48)}\n`.repeat(20); |
|
+let out = `${'o'.repeat(48)}\n`.repeat(20); |
// Add the remaining 24 bytes and terminate with an 'O'. |
|
// Add the remaining 24 bytes and terminate with an 'O'. |
// This results in 1025 bytes, just enough to overflow the 1kb OS X TTY buffer. |
|
// This results in 1025 bytes, just enough to overflow the 1kb OS X TTY buffer. |
-out += 'o'.repeat(24) + 'O'; |
|
-out += 'o'.repeat(24) + 'O'; |
+out += `${'o'.repeat(24)}O`; |
|
+out += `${'o'.repeat(24)}O`; |
|
|
|
// In AIX, the child exits even before the python parent |
<> |
process.stdout.write(out); |
// can setup the readloop. Provide a reasonable delay. |
|
process.exit(0); |
diff --git a/test/pseudo-tty/no_interleaved_stdio.js b/test/pseudo-tty/no_interleaved_stdio.js |
= |
diff --git a/test/pseudo-tty/no_interleaved_stdio.js b/test/pseudo-tty/no_interleaved_stdio.js |
|
|
|
--- a/test/pseudo-tty/no_interleaved_stdio.js |
|
--- a/test/pseudo-tty/no_interleaved_stdio.js |
+++ b/test/pseudo-tty/no_interleaved_stdio.js |
|
+++ b/test/pseudo-tty/no_interleaved_stdio.js |
|
|
|
// 1000 bytes wrapped at 50 columns |
|
// 1000 bytes wrapped at 50 columns |
// \n turns into a double-byte character |
|
// \n turns into a double-byte character |
// (48 + {2}) * 20 = 1000 |
|
// (48 + {2}) * 20 = 1000 |
-let out = ('o'.repeat(48) + '\n').repeat(20); |
|
-let out = ('o'.repeat(48) + '\n').repeat(20); |
+let out = `${'o'.repeat(48)}\n`.repeat(20); |
|
+let out = `${'o'.repeat(48)}\n`.repeat(20); |
|
- console.log('secure error: ' + err); |
= |
- console.log('secure error: ' + err); |
+ console.log(`secure error: ${err}`); |
|
+ console.log(`secure error: ${err}`); |
}); |
|
}); |
} |
|
} |
|
|
|
diff --git a/test/pummel/test-tls-server-large-request.js b/test/pummel/test-tls-server-large-request.js |
|
diff --git a/test/pummel/test-tls-server-large-request.js b/test/pummel/test-tls-server-large-request.js |
|
|
|
--- a/test/pummel/test-tls-server-large-request.js |
|
--- a/test/pummel/test-tls-server-large-request.js |
+++ b/test/pummel/test-tls-server-large-request.js |
|
+++ b/test/pummel/test-tls-server-large-request.js |
|
|
|
const request = Buffer.from('ABCD'.repeat(1024 * 256 - 1)); // 1mb |
<> |
const request = Buffer.from(new Array(1024 * 256).join('ABCD')); // 1mb |
|
= |
|
const options = { |
|
const options = { |
- key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), |
|
- key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), |
- cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem') |
|
- cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem') |
+ key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), |
|
+ key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), |
+ cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`) |
|
+ cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`) |
}; |
|
}; |
|
|
|
function Mediator() { |
|
function Mediator() { |
diff --git a/test/pummel/test-tls-session-timeout.js b/test/pummel/test-tls-session-timeout.js |
|
diff --git a/test/pummel/test-tls-session-timeout.js b/test/pummel/test-tls-session-timeout.js |
|
+ assert.strictEqual(require(`${loadOrder}file4`).file4, 'file4.reg', msg); |
= |
+assert.strictEqual(require(`${loadOrder}file4`).file4, 'file4.reg', msg); |
+ assert.strictEqual(require(`${loadOrder}file5`).file5, 'file5.reg2', msg); |
|
+assert.strictEqual(require(`${loadOrder}file5`).file5, 'file5.reg2', msg); |
+ assert.strictEqual(require(`${loadOrder}file6`).file6, 'file6/ |
|
+assert.strictEqual(require(`${loadOrder}file6`).file6, 'file6/ |
try { |
|
try { |
- require(loadOrder + 'file7'); |
|
- require(loadOrder + 'file7'); |
+ require(`${loadOrder}file7`); |
|
+ require(`${loadOrder}file7`); |
} catch (e) { |
|
} catch (e) { |
assert.ok(e.message.replace(/\\/g, '/').match(/file7\/ |
|
assert.ok(e.message.replace(/\\/g, '/').match(/file7\/ |
} |
|
} |
- assert.strictEqual(require(loadOrder + 'file8').file8, 'file8/ |
|
-assert.strictEqual(require(loadOrder + 'file8').file8, 'file8/ |
|
-+ |
-assert.strictEqual(require(loadOrder + 'file9').file9, 'file9/index.reg2', msg); |
+ assert.strictEqual(require(`${loadOrder}file8`).file8, 'file8/ |
= |
+assert.strictEqual(require(`${loadOrder}file8`).file8, 'file8/ |
msg); |
+- |
|
- assert.strictEqual(require(loadOrder + 'file9').file9, 'file9/index.reg2', |
|
|
+ assert.strictEqual(require(`${loadOrder}file9`).file9, 'file9/ |
= |
+assert.strictEqual(require(`${loadOrder}file9`).file9, 'file9/ |
msg); |
<> |
|
} |
|
|
|
= |
|
|
-+ |
// make sure that module.require() is the same as |
diff --git a/test/sequential/test-net-GH-5504.js b/test/sequential/test-net-GH-5504.js |
= |
diff --git a/test/sequential/test-net-GH-5504.js b/test/sequential/test-net-GH-5504.js |
|
|
|
--- a/test/sequential/test-net-GH-5504.js |
|
--- a/test/sequential/test-net-GH-5504.js |
+++ b/test/sequential/test-net-GH-5504.js |
|
+++ b/test/sequential/test-net-GH-5504.js |
|
|
|
inp.on('data', function(c) { |
|
inp.on('data', function(c) { |
c = c.trim(); |
|
c = c.trim(); |
if (!c) return; |
|
if (!c) return; |
- out.write(w + c.split('\n').join('\n' + w) + '\n'); |
|
- out.write(w + c.split('\n').join('\n' + w) + '\n'); |
+ out.write(`${w}${c.split('\n').join(`\n${w}`)}\n`); |
|
+ out.write(`${w}${c.split('\n').join(`\n${w}`)}\n`); |
}); |
|
}); |
} |
|
} |
} |
|
} |
|
-+ |
diff --git a/test/sequential/test-net-listen-shared-ports.js b/test/sequential/test-net-listen-shared-ports.js |
|
= |
|
|
-+ |
--- a/test/sequential/test-net-listen-shared-ports.js |
|
|
+++ b/test/sequential/test-net-listen-shared-ports.js |
|
= |
|
|
|
|
|
-+ |
server1.on('error', function(err) { |
|
|
// no errors expected |
|
|
- process.send('server1:' + err.code); |
|
|
+ process.send(`server1:${err.code}`); |
|
|
}); |
|
= |
|
|
-+ |
server2.on('error', function(err) { |
|
|
// an error is expected on the second worker |
|
|
- process.send('server2:' + err.code); |
|
|
+ process.send(`server2:${err.code}`); |
|
|
}); |
|
= |
|
|
-+ |
server1.listen({ |
diff --git a/test/sequential/test-process-warnings.js b/test/sequential/test-process-warnings.js |
= |
diff --git a/test/sequential/test-process-warnings.js b/test/sequential/test-process-warnings.js |
|
|
|
--- a/test/sequential/test-process-warnings.js |
|
--- a/test/sequential/test-process-warnings.js |
+++ b/test/sequential/test-process-warnings.js |
|
+++ b/test/sequential/test-process-warnings.js |
|
|
|
const common = require('../common'); |
|
const common = require('../common'); |
const assert = require('assert'); |
|
const assert = require('assert'); |
const execFile = require('child_process').execFile; |
|
const execFile = require('child_process').execFile; |
-const warnmod = require.resolve(common.fixturesDir + '/warnings.js'); |
|
-const warnmod = require.resolve(common.fixturesDir + '/warnings.js'); |
+const warnmod = require.resolve(`${common.fixturesDir}/warnings.js`); |
|
+const warnmod = require.resolve(`${common.fixturesDir}/warnings.js`); |