summaryrefslogtreecommitdiff
path: root/test/parallel/test-https-close.js
diff options
context:
space:
mode:
authorprodroy1 <prodroy1@in.ibm.com>2018-11-23 09:00:31 +0000
committerRich Trott <rtrott@gmail.com>2018-11-23 22:27:19 -0800
commite2140697aa095ac3dfc469c759e3f26edea6c08f (patch)
tree3dd7cc4ac28353ff7bbe39e4d900eafc64b3abd8 /test/parallel/test-https-close.js
parentce890a0d900f3847730b07022973c7a0a7c1779a (diff)
downloadandroid-node-v8-e2140697aa095ac3dfc469c759e3f26edea6c08f.tar.gz
android-node-v8-e2140697aa095ac3dfc469c759e3f26edea6c08f.tar.bz2
android-node-v8-e2140697aa095ac3dfc469c759e3f26edea6c08f.zip
test: replace callback with arrow functions
PR-URL: https://github.com/nodejs/node/pull/24434 Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'test/parallel/test-https-close.js')
-rw-r--r--test/parallel/test-https-close.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/parallel/test-https-close.js b/test/parallel/test-https-close.js
index f33754fb81..d9ed2ba1de 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);
});