Skip to content

Commit 2ffbde3

Browse files
UjjwalUpadhyay123-bitcodebytere
authored andcommitted
test: favor arrow functions in callbacks
PR-URL: #24425 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 8f7326c commit 2ffbde3

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎test/parallel/test-https-agent-servername.js‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict';
22
constcommon=require('../common');
3+
constassert=require('assert');
34

45
if(!common.hasCrypto)
56
common.skip('missing crypto');
@@ -14,7 +15,7 @@ const options = {
1415
};
1516

1617

17-
constserver=https.Server(options,function(req,res){
18+
constserver=https.Server(options,(req,res)=>{
1819
res.writeHead(200);
1920
res.end('hello world\n');
2021
});
@@ -27,11 +28,11 @@ server.listen(0, function() {
2728
rejectUnauthorized: true,
2829
servername: 'agent1',
2930
ca: options.ca
30-
},function(res){
31+
},(res)=>{
3132
res.resume();
32-
console.log(res.statusCode);
33+
assert.strictEqual(res.statusCode,200);
3334
server.close();
34-
}).on('error',function(e){
35+
}).on('error',(e)=>{
3536
console.log(e.message);
3637
process.exit(1);
3738
});

0 commit comments

Comments
 (0)