From b61ca1bfe6db7fe26aaeff4c544d5e3b1a10d32f Mon Sep 17 00:00:00 2001 From: Aleksandr Krutko Date: Sat, 14 Nov 2020 16:55:08 +0200 Subject: [PATCH] test: replace anonymous functions by arrows PR-URL: https://github.com/nodejs/node/pull/36125 Reviewed-By: Rich Trott Reviewed-By: Benjamin Gruenbaum Reviewed-By: Harshitha K P --- test/parallel/test-https-agent.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/parallel/test-https-agent.js b/test/parallel/test-https-agent.js index 4b2f9e73a1cd79..ce4bc6e5bdb86b 100644 --- a/test/parallel/test-https-agent.js +++ b/test/parallel/test-https-agent.js @@ -35,7 +35,7 @@ const options = { }; -const server = https.Server(options, function(req, res) { +const server = https.Server(options, (req, res) => { res.writeHead(200); res.end('hello world\n'); }); @@ -46,9 +46,9 @@ const N = 4; const M = 4; -server.listen(0, function() { +server.listen(0, () => { for (let i = 0; i < N; i++) { - setTimeout(function() { + setTimeout(() => { for (let j = 0; j < M; j++) { https.get({ path: '/', @@ -58,7 +58,7 @@ server.listen(0, function() { res.resume(); assert.strictEqual(res.statusCode, 200); if (++responses === N * M) server.close(); - }).on('error', function(e) { + }).on('error', (e) => { throw e; }); } @@ -67,6 +67,6 @@ server.listen(0, function() { }); -process.on('exit', function() { +process.on('exit', () => { assert.strictEqual(responses, N * M); });