Skip to content

Commit 5684da5

Browse files
yathamravaliaddaleax
yathamravali
authored andcommitted
test: changed function to arrow function
PR-URL: #25441 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
1 parent 291cedf commit 5684da5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/parallel/test-http.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const url = require('url');
2727

2828
const expectedRequests = ['/hello', '/there', '/world'];
2929

30-
const server = http.Server(common.mustCall(function(req, res) {
30+
const server = http.Server(common.mustCall((req, res) => {
3131
assert.strictEqual(expectedRequests.shift(), req.url);
3232

3333
switch (req.url) {
@@ -50,9 +50,9 @@ const server = http.Server(common.mustCall(function(req, res) {
5050
}
5151

5252
if (expectedRequests.length === 0)
53-
this.close();
53+
server.close();
5454

55-
req.on('end', function() {
55+
req.on('end', () => {
5656
res.writeHead(200, { 'Content-Type': 'text/plain' });
5757
res.write(`The path was ${url.parse(req.url).pathname}`);
5858
res.end();
@@ -61,10 +61,10 @@ const server = http.Server(common.mustCall(function(req, res) {
6161
}, 3));
6262
server.listen(0);
6363

64-
server.on('listening', function() {
65-
const agent = new http.Agent({ port: this.address().port, maxSockets: 1 });
64+
server.on('listening', () => {
65+
const agent = new http.Agent({ port: server.address().port, maxSockets: 1 });
6666
const req = http.get({
67-
port: this.address().port,
67+
port: server.address().port,
6868
path: '/hello',
6969
headers: {
7070
Accept: '*/*',

0 commit comments

Comments
 (0)