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');
27
27
const expected = 'This is a unicode text: سلام' ;
28
28
let result = '' ;
29
29
30
- const server = http . Server ( function ( req , res ) {
30
+ const server = http . Server ( ( req , res ) => {
31
31
req . setEncoding ( 'utf8' ) ;
32
- req . on ( 'data' , function ( chunk ) {
32
+ req . on ( 'data' , ( chunk ) => {
33
33
result += chunk ;
34
- } ) . on ( 'end' , function ( ) {
34
+ } ) . on ( 'end' , ( ) => {
35
35
server . close ( ) ;
36
36
res . writeHead ( 200 ) ;
37
37
res . end ( 'hello world\n' ) ;
@@ -44,15 +44,15 @@ server.listen(0, function() {
44
44
port : this . address ( ) . port ,
45
45
path : '/' ,
46
46
method : 'POST'
47
- } , function ( res ) {
47
+ } , ( res ) => {
48
48
console . log ( res . statusCode ) ;
49
49
res . resume ( ) ;
50
- } ) . on ( 'error' , function ( e ) {
50
+ } ) . on ( 'error' , ( e ) => {
51
51
console . log ( e . message ) ;
52
52
process . exit ( 1 ) ;
53
53
} ) . end ( expected ) ;
54
54
} ) ;
55
55
56
- process . on ( 'exit' , function ( ) {
56
+ process . on ( 'exit' , ( ) => {
57
57
assert . strictEqual ( expected , result ) ;
58
58
} ) ;
You can’t perform that action at this time.
0 commit comments