Skip to content

Commit cc03470

Browse files
routermanMylesBorins
authored andcommitted
test: change callback function to arrow function
PR-URL: #17697 Reviewed-By: Yosuke Furukawa <yosuke.furukawa@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent 81e6569 commit cc03470

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎test/parallel/test-http-default-encoding.js‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ const http = require('http');
66
constexpected='This is a unicode text: سلام';
77
letresult='';
88

9-
constserver=http.Server(function(req,res){
9+
constserver=http.Server((req,res)=>{
1010
req.setEncoding('utf8');
11-
req.on('data',function(chunk){
11+
req.on('data',(chunk)=>{
1212
result+=chunk;
13-
}).on('end',function(){
13+
}).on('end',()=>{
1414
server.close();
1515
res.writeHead(200);
1616
res.end('hello world\n');
@@ -23,15 +23,15 @@ server.listen(0, function() {
2323
port: this.address().port,
2424
path: '/',
2525
method: 'POST'
26-
},function(res){
26+
},(res)=>{
2727
console.log(res.statusCode);
2828
res.resume();
29-
}).on('error',function(e){
29+
}).on('error',(e)=>{
3030
console.log(e.message);
3131
process.exit(1);
3232
}).end(expected);
3333
});
3434

35-
process.on('exit',function(){
35+
process.on('exit',()=>{
3636
assert.strictEqual(expected,result);
3737
});

0 commit comments

Comments
 (0)