@@ -32,20 +32,20 @@ tmpdir.refresh();
32
32
const filename = path . join ( tmpdir . path || '/tmp' , 'big' ) ;
33
33
let count = 0 ;
34
34
35
- const server = http . createServer ( function ( req , res ) {
35
+ const server = http . createServer ( ( req , res ) => {
36
36
let timeoutId ;
37
37
assert . strictEqual ( req . method , 'POST' ) ;
38
38
req . pause ( ) ;
39
39
40
- setTimeout ( function ( ) {
40
+ setTimeout ( ( ) => {
41
41
req . resume ( ) ;
42
42
} , 1000 ) ;
43
43
44
- req . on ( 'data' , function ( chunk ) {
44
+ req . on ( 'data' , ( chunk ) => {
45
45
count += chunk . length ;
46
46
} ) ;
47
47
48
- req . on ( 'end' , function ( ) {
48
+ req . on ( 'end' , ( ) => {
49
49
if ( timeoutId ) {
50
50
clearTimeout ( timeoutId ) ;
51
51
}
@@ -55,7 +55,7 @@ const server = http.createServer(function(req, res) {
55
55
} ) ;
56
56
server . listen ( 0 ) ;
57
57
58
- server . on ( 'listening' , function ( ) {
58
+ server . on ( 'listening' , ( ) => {
59
59
common . createZeroFilledFile ( filename ) ;
60
60
makeRequest ( ) ;
61
61
} ) ;
@@ -73,14 +73,14 @@ function makeRequest() {
73
73
assert . ifError ( err ) ;
74
74
} ) ) ;
75
75
76
- req . on ( 'response' , function ( res ) {
76
+ req . on ( 'response' , ( res ) => {
77
77
res . resume ( ) ;
78
- res . on ( 'end' , function ( ) {
78
+ res . on ( 'end' , ( ) => {
79
79
server . close ( ) ;
80
80
} ) ;
81
81
} ) ;
82
82
}
83
83
84
- process . on ( 'exit' , function ( ) {
84
+ process . on ( 'exit' , ( ) => {
85
85
assert . strictEqual ( count , 1024 * 10240 ) ;
86
86
} ) ;
0 commit comments