Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup: sequential
  • Loading branch information
vsemozhetbyt committed May 5, 2017
commit 8f3a2dcd9523add064ab549a29ed68904cbea180
6 changes: 3 additions & 3 deletions test/sequential/test-child-process-execsync.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ assert.throws(function() {
}, /Command failed: iamabadcommand/);

const msg = 'foobar';
const msgBuf = Buffer.from(msg + '\n');
const msgBuf = Buffer.from(`${msg}\n`);

// console.log ends every line with just '\n', even on Windows.

Expand All @@ -79,7 +79,7 @@ assert.deepStrictEqual(ret, msgBuf, 'execSync result buffer should match');

ret = execSync(cmd, { encoding: 'utf8' });

assert.strictEqual(ret, msg + '\n', 'execSync encoding result should match');
assert.strictEqual(ret, `${msg}\n`, 'execSync encoding result should match');

const args = [
'-e',
Expand All @@ -91,7 +91,7 @@ assert.deepStrictEqual(ret, msgBuf);

ret = execFileSync(process.execPath, args, { encoding: 'utf8' });

assert.strictEqual(ret, msg + '\n',
assert.strictEqual(ret, `${msg}\n`,
'execFileSync encoding result should match');

// Verify that the cwd option works - GH #7824
Expand Down
8 changes: 4 additions & 4 deletions test/sequential/test-deprecation-flags.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@
const common = require('../common');
const assert = require('assert');
const execFile = require('child_process').execFile;
const depmod = require.resolve(common.fixturesDir + '/deprecated.js');
const depmod = require.resolve(`${common.fixturesDir}/deprecated.js`);
const node = process.execPath;

const depUserlandFunction =
require.resolve(common.fixturesDir + '/deprecated-userland-function.js');
require.resolve(`${common.fixturesDir}/deprecated-userland-function.js`);

const depUserlandClass =
require.resolve(common.fixturesDir + '/deprecated-userland-class.js');
require.resolve(`${common.fixturesDir}/deprecated-userland-class.js`);

const depUserlandSubClass =
require.resolve(common.fixturesDir + '/deprecated-userland-subclass.js');
require.resolve(`${common.fixturesDir}/deprecated-userland-subclass.js`);

const normal = [depmod];
const noDep = ['--no-deprecation', depmod];
Expand Down
4 changes: 2 additions & 2 deletions test/sequential/test-dgram-pingpong.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function pingPongTest(port, host) {
});

server.on('listening', function() {
console.log('server listening on ' + port);
console.log(`server listening on ${port}`);

const client = dgram.createSocket('udp4');

Expand All @@ -30,7 +30,7 @@ function pingPongTest(port, host) {
throw e;
});

console.log('Client sending to ' + port);
console.log(`Client sending to ${port}`);

function clientSend() {
client.send('PING', 0, 4, port, 'localhost');
Expand Down
7 changes: 4 additions & 3 deletions test/sequential/test-domain-abort-on-uncaught.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,10 @@ if (process.argv[2] === 'child') {
const child = child_process.exec(testCmd);

child.on('exit', function onExit(code, signal) {
assert.strictEqual(code, 0, 'Test at index ' + testIndex +
' should have exited with exit code 0 but instead exited with code ' +
code + ' and signal ' + signal);
assert.strictEqual(
code, 0, `Test at index ${testIndex
} should have exited with exit code 0 but instead exited with code ${
code} and signal ${signal}`);
});
});
}
4 changes: 2 additions & 2 deletions test/sequential/test-https-set-timeout-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ const fs = require('fs');
const tests = [];

const serverOptions = {
key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'),
cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem')
key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`),
cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`)
};

function test(fn) {
Expand Down
18 changes: 9 additions & 9 deletions test/sequential/test-module-loading.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,25 +189,25 @@ try {
require.extensions['.reg'] = require.extensions['.js'];
require.extensions['.reg2'] = require.extensions['.js'];

assert.strictEqual(require(loadOrder + 'file1').file1, 'file1', msg);
assert.strictEqual(require(loadOrder + 'file2').file2, 'file2.js', msg);
assert.strictEqual(require(`${loadOrder}file1`).file1, 'file1', msg);
assert.strictEqual(require(`${loadOrder}file2`).file2, 'file2.js', msg);
try {
require(loadOrder + 'file3');
require(`${loadOrder}file3`);
} catch (e) {
// Not a real .node module, but we know we require'd the right thing.
assert.ok(e.message.replace(/\\/g, '/').match(/file3\.node/));
}
assert.strictEqual(require(loadOrder + 'file4').file4, 'file4.reg', msg);
assert.strictEqual(require(loadOrder + 'file5').file5, 'file5.reg2', msg);
assert.strictEqual(require(loadOrder + 'file6').file6, 'file6/index.js', msg);
assert.strictEqual(require(`${loadOrder}file4`).file4, 'file4.reg', msg);
assert.strictEqual(require(`${loadOrder}file5`).file5, 'file5.reg2', msg);
assert.strictEqual(require(`${loadOrder}file6`).file6, 'file6/index.js', msg);
try {
require(loadOrder + 'file7');
require(`${loadOrder}file7`);
} catch (e) {
assert.ok(e.message.replace(/\\/g, '/').match(/file7\/index\.node/));
}
assert.strictEqual(require(loadOrder + 'file8').file8, 'file8/index.reg',
assert.strictEqual(require(`${loadOrder}file8`).file8, 'file8/index.reg',
msg);
assert.strictEqual(require(loadOrder + 'file9').file9, 'file9/index.reg2',
assert.strictEqual(require(`${loadOrder}file9`).file9, 'file9/index.reg2',
msg);
}

Expand Down
2 changes: 1 addition & 1 deletion test/sequential/test-net-GH-5504.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function parent() {
inp.on('data', function(c) {
c = c.trim();
if (!c) return;
out.write(w + c.split('\n').join('\n' + w) + '\n');
out.write(`${w}${c.split('\n').join(`\n${w}`)}\n`);
});
}
}
2 changes: 1 addition & 1 deletion test/sequential/test-process-warnings.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const common = require('../common');
const assert = require('assert');
const execFile = require('child_process').execFile;
const warnmod = require.resolve(common.fixturesDir + '/warnings.js');
const warnmod = require.resolve(`${common.fixturesDir}/warnings.js`);
const node = process.execPath;

const normal = [warnmod];
Expand Down
2 changes: 1 addition & 1 deletion test/sequential/test-regress-GH-1697.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if (process.argv[2] === 'server') {

const server = net.createServer(function(conn) {
conn.on('data', function(data) {
console.log('server received ' + data.length + ' bytes');
console.log(`server received ${data.length} bytes`);
});

conn.on('close', function() {
Expand Down
4 changes: 2 additions & 2 deletions test/sequential/test-regress-GH-4015.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ const common = require('../common');
const assert = require('assert');
const exec = require('child_process').exec;

const cmd = '"' + process.execPath + '" ' +
'"' + common.fixturesDir + '/test-regress-GH-4015.js"';
const cmd =
`"${process.execPath}" "${common.fixturesDir}/test-regress-GH-4015.js"`;

exec(cmd, function(err, stdout, stderr) {
assert(/RangeError: Maximum call stack size exceeded/.test(stderr));
Expand Down
4 changes: 2 additions & 2 deletions test/sequential/test-regress-GH-784.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const responses = [];

function afterPing(result) {
responses.push(result);
console.error('afterPing. responses.length = ' + responses.length);
console.error(`afterPing. responses.length = ${responses.length}`);
switch (responses.length) {
case 2:
assert.ok(/ECONNREFUSED/.test(responses[0]));
Expand Down Expand Up @@ -130,7 +130,7 @@ function ping() {
let hadError = false;

req.on('error', function(error) {
console.log('Error making ping req: ' + error);
console.log(`Error making ping req: ${error}`);
hadError = true;
assert.ok(!gotEnd);
afterPing(error.message);
Expand Down
7 changes: 4 additions & 3 deletions test/sequential/test-regress-GH-877.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@ server.listen(common.PORT, '127.0.0.1', function() {

assert.strictEqual(req.agent, agent);

console.log('Socket: ' + agent.sockets[addrString].length + '/' +
agent.maxSockets + ' queued: ' + (agent.requests[addrString] ?
agent.requests[addrString].length : 0));
console.log(
`Socket: ${agent.sockets[addrString].length}/${
agent.maxSockets} queued: ${
agent.requests[addrString] ? agent.requests[addrString].length : 0}`);

const agentRequests = agent.requests[addrString] ?
agent.requests[addrString].length : 0;
Expand Down
2 changes: 1 addition & 1 deletion test/sequential/test-repl-timeout-throw.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ child.stdout.once('data', function() {
setTimeout(fsTest, 50);
function fsTest() {
const f = JSON.stringify(__filename);
child.stdin.write('fs.readFile(' + f + ', thrower);\n');
child.stdin.write(`fs.readFile(${f}, thrower);\n`);
setTimeout(eeTest, 50);
}

Expand Down
4 changes: 2 additions & 2 deletions test/sequential/test-require-cache-without-stat.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fs.stat = function() {
};

// Load the module 'a' and 'http' once. It should become cached.
require(common.fixturesDir + '/a');
require(`${common.fixturesDir}/a`);
require('../fixtures/a.js');
require('./../fixtures/a.js');
require('http');
Expand All @@ -57,7 +57,7 @@ const counterBefore = counter;
// Now load the module a bunch of times with equivalent paths.
// stat should not be called.
for (let i = 0; i < 100; i++) {
require(common.fixturesDir + '/a');
require(`${common.fixturesDir}/a`);
require('../fixtures/a.js');
require('./../fixtures/a.js');
}
Expand Down
6 changes: 3 additions & 3 deletions test/sequential/test-stream2-stderr-sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@ function parent() {
const assert = require('assert');
let i = 0;
children.forEach(function(_, c) {
const child = spawn(process.execPath, [__filename, '' + c]);
const child = spawn(process.execPath, [__filename, String(c)]);
let err = '';

child.stderr.on('data', function(c) {
err += c;
});

child.on('close', function() {
assert.strictEqual(err, 'child ' + c + '\nfoo\nbar\nbaz\n');
assert.strictEqual(err, `child ${c}\nfoo\nbar\nbaz\n`);
console.log('ok %d child #%d', ++i, c);
if (i === children.length)
console.log('1..' + i);
console.log(`1..${i}`);
});
});
}
Expand Down