Skip to content

Commit 8c4903d

Browse files
cjihrigMyles Borins
authored and
Myles Borins
committed
test: update arrow function style
This commit applies new arrow function linting rules across the codebase. As it turns out, the only offenders were in the test directory. PR-URL: #4813 Reviewed-By: Rod Vagg <[email protected]> Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Saúl Ibarra Corretgé <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
1 parent 38474cf commit 8c4903d

10 files changed

+18
-18
lines changed

test/common.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ exports.nodeProcessAborted = function nodeProcessAborted(exitCode, signal) {
503503
// A stream to push an array into a REPL
504504
function ArrayStream() {
505505
this.run = function(data) {
506-
data.forEach(line => {
506+
data.forEach((line) => {
507507
this.emit('data', line + '\n');
508508
});
509509
};

test/parallel/test-assert.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ testBlockTypeError(assert.throws, undefined);
481481
testBlockTypeError(assert.doesNotThrow, undefined);
482482

483483
// https://github.com/nodejs/node/issues/3275
484-
assert.throws(() => { throw 'error'; }, err => err === 'error');
485-
assert.throws(() => { throw new Error(); }, err => err instanceof Error);
484+
assert.throws(() => { throw 'error'; }, (err) => err === 'error');
485+
assert.throws(() => { throw new Error(); }, (err) => err instanceof Error);
486486

487487
console.log('All OK');

test/parallel/test-async-wrap-check-providers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ keyList.splice(0, 1);
2020

2121

2222
function init(id) {
23-
keyList = keyList.filter(e => e != pkeys[id]);
23+
keyList = keyList.filter((e) => e != pkeys[id]);
2424
}
2525

2626
function noop() { }

test/parallel/test-cluster-disconnect-handles.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ if (cluster.isMaster) {
3131
// scanner but is ignored by atoi(3). Heinous hack.
3232
cluster.setupMaster({ execArgv: [`--debug=${common.PORT}.`] });
3333
const worker = cluster.fork();
34-
worker.on('message', common.mustCall(message => {
34+
worker.on('message', common.mustCall((message) => {
3535
assert.strictEqual(Array.isArray(message), true);
3636
assert.strictEqual(message[0], 'listening');
3737
let continueRecv = false;
@@ -40,9 +40,9 @@ if (cluster.isMaster) {
4040
const debugClient = net.connect({ host, port: common.PORT });
4141
const protocol = new Protocol();
4242
debugClient.setEncoding('utf8');
43-
debugClient.on('data', data => protocol.execute(data));
43+
debugClient.on('data', (data) => protocol.execute(data));
4444
debugClient.once('connect', common.mustCall(() => {
45-
protocol.onResponse = common.mustCall(res => {
45+
protocol.onResponse = common.mustCall((res) => {
4646
protocol.onResponse = (res) => {
4747
// It can happen that the first continue was sent before the break
4848
// event was received. If that's the case, send also a continue from
@@ -85,7 +85,7 @@ if (cluster.isMaster) {
8585
throw ex;
8686
});
8787
} else {
88-
const server = net.createServer(socket => socket.pipe(socket));
88+
const server = net.createServer((socket) => socket.pipe(socket));
8989
const cb = () => {
9090
process.send(['listening', server.address()]);
9191
debugger;

test/parallel/test-debug-no-context.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ proc.on('exit', common.mustCall((exitCode, signalCode) => {
1717
}));
1818
let stdout = '';
1919
proc.stdout.setEncoding('utf8');
20-
proc.stdout.on('data', data => stdout += data);
20+
proc.stdout.on('data', (data) => stdout += data);
2121
process.on('exit', () => {
2222
assert(stdout.includes('Promise { 42 }'));
2323
assert(stdout.includes('Promise { 1337 }'));

test/parallel/test-debug-port-cluster.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const child = spawn(process.execPath, args);
1515
child.stderr.setEncoding('utf8');
1616

1717
let stderr = '';
18-
child.stderr.on('data', data => {
18+
child.stderr.on('data', (data) => {
1919
stderr += data;
2020
if (child.killed !== true && stderr.includes('all workers are running'))
2121
child.kill();

test/parallel/test-net-socket-local-address.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ var conns = 0;
1313
var clientLocalPorts = [];
1414
var serverRemotePorts = [];
1515
const client = new net.Socket();
16-
const server = net.createServer(socket => {
16+
const server = net.createServer((socket) => {
1717
serverRemotePorts.push(socket.remotePort);
1818
socket.end();
1919
});

test/parallel/test-process-emit.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ const common = require('../common');
33
const assert = require('assert');
44
const sym = Symbol();
55

6-
process.on('normal', common.mustCall(data => {
6+
process.on('normal', common.mustCall((data) => {
77
assert.strictEqual(data, 'normalData');
88
}));
99

10-
process.on(sym, common.mustCall(data => {
10+
process.on(sym, common.mustCall((data) => {
1111
assert.strictEqual(data, 'symbolData');
1212
}));
1313

14-
process.on('SIGPIPE', common.mustCall(data => {
14+
process.on('SIGPIPE', common.mustCall((data) => {
1515
assert.strictEqual(data, 'signalData');
1616
}));
1717

test/parallel/test-repl-require.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const net = require('net');
77
process.chdir(common.fixturesDir);
88
const repl = require('repl');
99

10-
const server = net.createServer(conn => {
10+
const server = net.createServer((conn) => {
1111
repl.start('', conn).on('exit', () => {
1212
conn.destroy();
1313
server.close();
@@ -22,7 +22,7 @@ var answer = '';
2222
server.listen(options, function() {
2323
const conn = net.connect(options);
2424
conn.setEncoding('utf8');
25-
conn.on('data', data => answer += data);
25+
conn.on('data', (data) => answer += data);
2626
conn.write('require("baz")\n.exit\n');
2727
});
2828

test/parallel/test-tls-no-sslv3.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ server.listen(common.PORT, '127.0.0.1', function() {
4040
client.stdout.pipe(process.stdout);
4141
client.stderr.pipe(process.stderr);
4242
client.stderr.setEncoding('utf8');
43-
client.stderr.on('data', data => stderr += data);
43+
client.stderr.on('data', (data) => stderr += data);
4444

4545
client.once('exit', common.mustCall(function(exitCode) {
4646
assert.equal(exitCode, 1);
4747
server.close();
4848
}));
4949
});
5050

51-
server.on('clientError', err => errors.push(err));
51+
server.on('clientError', (err) => errors.push(err));
5252

5353
process.on('exit', function() {
5454
if (/unknown option -ssl3/.test(stderr)) {

0 commit comments

Comments
 (0)