Skip to content
Closed
Changes from all commits
Commits
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
code: annonymous functions are replaced by arrow function
  • Loading branch information
PoojaDurgad committed Aug 25, 2020
commit 1a266cc402fae2ff0f0846d40aac249c07712240
12 changes: 6 additions & 6 deletions test/parallel/test-net-reconnect.js
Original file line number Diff line number Diff line change
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