Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
test: replace annonymous functions with arrow
PR-URL: #34921
Reviewed-By: Harshitha K P <harshitha014@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
  • Loading branch information
PoojaDurgad authored and MylesBorins committed Nov 16, 2020
1 parent cf07a86 commit fdc67eb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/parallel/test-net-reconnect.js
Expand Up @@ -37,12 +37,12 @@ const server = net.createServer(function(socket) {
console.error('SERVER connect, writing');
socket.write('hello\r\n');

socket.on('end', function() {
socket.on('end', () => {
console.error('SERVER socket end, calling end()');
socket.end();
});

socket.on('close', function(had_error) {
socket.on('close', (had_error) => {
console.log(`SERVER had_error: ${JSON.stringify(had_error)}`);
assert.strictEqual(had_error, false);
});
Expand All @@ -54,7 +54,7 @@ server.listen(0, function() {

client.setEncoding('UTF8');

client.on('connect', function() {
client.on('connect', () => {
console.error('CLIENT connected', client._writableState);
});

Expand All @@ -66,12 +66,12 @@ server.listen(0, function() {
client.end();
});

client.on('end', function() {
client.on('end', () => {
console.error('CLIENT end');
client_end_count++;
});

client.on('close', function(had_error) {
client.on('close', (had_error) => {
console.log('CLIENT disconnect');
assert.strictEqual(had_error, false);
if (disconnect_count++ < N)
Expand All @@ -81,7 +81,7 @@ server.listen(0, function() {
});
});

process.on('exit', function() {
process.on('exit', () => {
assert.strictEqual(disconnect_count, N + 1);
assert.strictEqual(client_recv_count, N + 1);
assert.strictEqual(client_end_count, N + 1);
Expand Down

0 comments on commit fdc67eb

Please sign in to comment.