Skip to content

Commit

Permalink
test: changed function to arrow function
Browse files Browse the repository at this point in the history
PR-URL: #25441
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
  • Loading branch information
yathamravali authored and addaleax committed Jan 23, 2019
1 parent 291cedf commit 5684da5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/parallel/test-http.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const url = require('url');

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

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

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

if (expectedRequests.length === 0)
this.close();
server.close();

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

server.on('listening', function() {
const agent = new http.Agent({ port: this.address().port, maxSockets: 1 });
server.on('listening', () => {
const agent = new http.Agent({ port: server.address().port, maxSockets: 1 });
const req = http.get({
port: this.address().port,
port: server.address().port,
path: '/hello',
headers: {
Accept: '*/*',
Expand Down

0 comments on commit 5684da5

Please sign in to comment.