File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -27,11 +27,11 @@ const http = require('http');
2727const expected = 'This is a unicode text: سلام' ;
2828let result = '' ;
2929
30- const server = http . Server ( function ( req , res ) {
30+ const server = http . Server ( ( req , res ) => {
3131 req . setEncoding ( 'utf8' ) ;
32- req . on ( 'data' , function ( chunk ) {
32+ req . on ( 'data' , ( chunk ) => {
3333 result += chunk ;
34- } ) . on ( 'end' , function ( ) {
34+ } ) . on ( 'end' , ( ) => {
3535 server . close ( ) ;
3636 res . writeHead ( 200 ) ;
3737 res . end ( 'hello world\n' ) ;
@@ -44,15 +44,15 @@ server.listen(0, function() {
4444 port : this . address ( ) . port ,
4545 path : '/' ,
4646 method : 'POST'
47- } , function ( res ) {
47+ } , ( res ) => {
4848 console . log ( res . statusCode ) ;
4949 res . resume ( ) ;
50- } ) . on ( 'error' , function ( e ) {
50+ } ) . on ( 'error' , ( e ) => {
5151 console . log ( e . message ) ;
5252 process . exit ( 1 ) ;
5353 } ) . end ( expected ) ;
5454} ) ;
5555
56- process . on ( 'exit' , function ( ) {
56+ process . on ( 'exit' , ( ) => {
5757 assert . strictEqual ( expected , result ) ;
5858} ) ;
You can’t perform that action at this time.
0 commit comments