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 @@ -6,11 +6,11 @@ const http = require('http');
66const expected = 'This is a unicode text: سلام' ;
77let result = '' ;
88
9- const server = http . Server ( function ( req , res ) {
9+ const server = 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} ) ;
You can’t perform that action at this time.
0 commit comments