Skip to content

Commit 1067653

Browse files
prodroy1rvagg
authored andcommitted
test: replace callback with arrow functions
PR-URL: #24434 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent 5796c6a commit 1067653

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

‎test/parallel/test-https-close.js‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ const options ={
1313

1414
constconnections={};
1515

16-
constserver=https.createServer(options,function(req,res){
17-
constinterval=setInterval(function(){
16+
constserver=https.createServer(options,(req,res)=>{
17+
constinterval=setInterval(()=>{
1818
res.write('data');
1919
},1000);
2020
interval.unref();
2121
});
2222

23-
server.on('connection',function(connection){
23+
server.on('connection',(connection)=>{
2424
constkey=`${connection.remoteAddress}:${connection.remotePort}`;
25-
connection.on('close',function(){
25+
connection.on('close',()=>{
2626
deleteconnections[key];
2727
});
2828
connections[key]=connection;
@@ -37,16 +37,16 @@ function shutdown(){
3737
}
3838
}
3939

40-
server.listen(0,function(){
40+
server.listen(0,()=>{
4141
constrequestOptions={
4242
hostname: '127.0.0.1',
43-
port: this.address().port,
43+
port: server.address().port,
4444
path: '/',
4545
method: 'GET',
4646
rejectUnauthorized: false
4747
};
4848

49-
constreq=https.request(requestOptions,function(res){
49+
constreq=https.request(requestOptions,(res)=>{
5050
res.on('data',()=>{});
5151
setImmediate(shutdown);
5252
});

0 commit comments

Comments
(0)