Skip to content

Commit 8237601

Browse files
codegaganBethGriggs
authored andcommitted
test: change anonymous function to arrow function
PR-URL: #24528 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent 95a3b3e commit 8237601

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎test/parallel/test-http-client-timeout-agent.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const options = {
3232
host: '127.0.0.1',
3333
};
3434

35-
constserver=http.createServer(function(req,res){
35+
constserver=http.createServer((req,res)=>{
3636
constm=/\/(.*)/.exec(req.url);
3737
constreqid=parseInt(m[1],10);
3838
if(reqid%2){
@@ -51,7 +51,7 @@ server.listen(0, options.host, function() {
5151
options.path=`/${requests_sent}`;
5252
constreq=http.request(options);
5353
req.id=requests_sent;
54-
req.on('response',function(res){
54+
req.on('response',(res)=>{
5555
res.on('data',function(data){
5656
console.log(`res#${this.req.id} data:${data}`);
5757
});
@@ -78,7 +78,7 @@ server.listen(0, options.host, function() {
7878

7979
setTimeout(functionmaybeDone(){
8080
if(requests_done>=requests_sent){
81-
setTimeout(function(){
81+
setTimeout(()=>{
8282
server.close();
8383
},100);
8484
}else{
@@ -87,7 +87,7 @@ server.listen(0, options.host, function() {
8787
},100);
8888
});
8989

90-
process.on('exit',function(){
90+
process.on('exit',()=>{
9191
console.error(`done=${requests_done} sent=${requests_sent}`);
9292
// check that timeout on http request was not called too much
9393
assert.strictEqual(requests_done,requests_sent);

0 commit comments

Comments
 (0)