Skip to content

Commit b61ca1b

Browse files
arsenalzpdanielleadams
authored andcommitted
test: replace anonymous functions by arrows
PR-URL: #36125 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Harshitha K P <harshitha014@gmail.com>
1 parent 537e5cb commit b61ca1b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/parallel/test-https-agent.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const options = {
3535
};
3636

3737

38-
const server = https.Server(options, function(req, res) {
38+
const server = https.Server(options, (req, res) => {
3939
res.writeHead(200);
4040
res.end('hello world\n');
4141
});
@@ -46,9 +46,9 @@ const N = 4;
4646
const M = 4;
4747

4848

49-
server.listen(0, function() {
49+
server.listen(0, () => {
5050
for (let i = 0; i < N; i++) {
51-
setTimeout(function() {
51+
setTimeout(() => {
5252
for (let j = 0; j < M; j++) {
5353
https.get({
5454
path: '/',
@@ -58,7 +58,7 @@ server.listen(0, function() {
5858
res.resume();
5959
assert.strictEqual(res.statusCode, 200);
6060
if (++responses === N * M) server.close();
61-
}).on('error', function(e) {
61+
}).on('error', (e) => {
6262
throw e;
6363
});
6464
}
@@ -67,6 +67,6 @@ server.listen(0, function() {
6767
});
6868

6969

70-
process.on('exit', function() {
70+
process.on('exit', () => {
7171
assert.strictEqual(responses, N * M);
7272
});

0 commit comments

Comments
 (0)