★ wanayoo — archive 1999 https://github.com/nodejs/node/commit/6b904f6799Nouvelle recherche | Portail wanayoo
Skip to content
Permalink
Browse files

test: change anonymous closure function to arrow function

PR-URL: #24433
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
  • Loading branch information...
nethraravindran authored and codebytere committed Nov 17, 2018
1 parent 46e63a2 commit 6b904f67993b57b6538d3b2d25398303a7dd4a01
Showing with 5 additions and 5 deletions.
  1. +5 −5 test/parallel/test-net-connect-options-port.js
@@ -76,15 +76,15 @@ const net = require('net');
const expectedConnections = 72;
let serverConnected = 0;

const server = net.createServer(common.mustCall(function(socket) {
const server = net.createServer(common.mustCall((socket) => {
socket.end('ok');
if (++serverConnected === expectedConnections) {
server.close();
}
}, expectedConnections));

server.listen(0, 'localhost', common.mustCall(function() {
const port = this.address().port;
server.listen(0, 'localhost', common.mustCall(() => {
const port = server.address().port;

// Total connections = 3 * 4(canConnect) * 6(doConnect) = 72
canConnect(port);
@@ -93,7 +93,7 @@ const net = require('net');
}));

// Try connecting to random ports, but do so once the server is closed
server.on('close', function() {
server.on('close', () => {
asyncFailToConnect(0);
asyncFailToConnect(/* undefined */);
});
@@ -193,7 +193,7 @@ function canConnect(port) {
}

function asyncFailToConnect(port) {
const onError = () => common.mustCall(function(err) {
const onError = () => common.mustCall((err) => {
const regexp = /^Error: connect E\w+.+$/;
assert(regexp.test(String(err)), String(err));
});

0 comments on commit 6b904f6

Please sign in to comment.
You can’t perform that action at this time.