Skip to content

Commit 6b88541

Browse files
codegaganrvagg
authored andcommitted
test: replace anonymous function with arrow
PR-URL: #24526 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
1 parent 765a81e commit 6b88541

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

‎test/parallel/test-pipe-file-to-http.js‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,20 @@ tmpdir.refresh();
3232
constfilename=path.join(tmpdir.path||'/tmp','big');
3333
letcount=0;
3434

35-
constserver=http.createServer(function(req,res){
35+
constserver=http.createServer((req,res)=>{
3636
lettimeoutId;
3737
assert.strictEqual(req.method,'POST');
3838
req.pause();
3939

40-
setTimeout(function(){
40+
setTimeout(()=>{
4141
req.resume();
4242
},1000);
4343

44-
req.on('data',function(chunk){
44+
req.on('data',(chunk)=>{
4545
count+=chunk.length;
4646
});
4747

48-
req.on('end',function(){
48+
req.on('end',()=>{
4949
if(timeoutId){
5050
clearTimeout(timeoutId);
5151
}
@@ -55,7 +55,7 @@ const server = http.createServer(function(req, res){
5555
});
5656
server.listen(0);
5757

58-
server.on('listening',function(){
58+
server.on('listening',()=>{
5959
common.createZeroFilledFile(filename);
6060
makeRequest();
6161
});
@@ -73,14 +73,14 @@ function makeRequest(){
7373
assert.ifError(err);
7474
}));
7575

76-
req.on('response',function(res){
76+
req.on('response',(res)=>{
7777
res.resume();
78-
res.on('end',function(){
78+
res.on('end',()=>{
7979
server.close();
8080
});
8181
});
8282
}
8383

84-
process.on('exit',function(){
84+
process.on('exit',()=>{
8585
assert.strictEqual(count,1024*10240);
8686
});

0 commit comments

Comments
(0)