From 10676532216695da46a6fef4047c52e22cc1426f Mon Sep 17 00:00:00 2001 From: prodroy1 Date: Fri, 23 Nov 2018 09:00:31 +0000 Subject: [PATCH] test: replace callback with arrow functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/24434 Reviewed-By: Michaƫl Zasso Reviewed-By: Trivikram Kamat Reviewed-By: Gireesh Punathil Reviewed-By: Anna Henningsen --- test/parallel/test-https-close.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/parallel/test-https-close.js b/test/parallel/test-https-close.js index f33754fb818940..d9ed2ba1de90a6 100644 --- a/test/parallel/test-https-close.js +++ b/test/parallel/test-https-close.js @@ -13,16 +13,16 @@ const options = { const connections = {}; -const server = https.createServer(options, function(req, res) { - const interval = setInterval(function() { +const server = https.createServer(options, (req, res) => { + const interval = setInterval(() => { res.write('data'); }, 1000); interval.unref(); }); -server.on('connection', function(connection) { +server.on('connection', (connection) => { const key = `${connection.remoteAddress}:${connection.remotePort}`; - connection.on('close', function() { + connection.on('close', () => { delete connections[key]; }); connections[key] = connection; @@ -37,16 +37,16 @@ function shutdown() { } } -server.listen(0, function() { +server.listen(0, () => { const requestOptions = { hostname: '127.0.0.1', - port: this.address().port, + port: server.address().port, path: '/', method: 'GET', rejectUnauthorized: false }; - const req = https.request(requestOptions, function(res) { + const req = https.request(requestOptions, (res) => { res.on('data', () => {}); setImmediate(shutdown); });