mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
test: replace annonymous functions with arrow
PR-URL: https://github.com/nodejs/node/pull/34921 Reviewed-By: Harshitha K P <harshitha014@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
This commit is contained in:
1 parent
cf07a8695a
commit
fdc67ebf5f
1 file changed
+6
-6
@@ -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);
|
||||
});
|
||||
@@ -54,7 +54,7 @@ server.listen(0, function() {
|
||||
|
||||
client.setEncoding('UTF8');
|
||||
|
||||
client.on('connect', function() {
|
||||
client.on('connect', () => {
|
||||
console.error('CLIENT connected', client._writableState);
|
||||
});
|
||||
|
||||
@@ -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)
|
||||
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user