@@ -28,29 +28,32 @@ const fs = require('fs');
28
28
const emptyFile = path . join ( common . fixturesDir , 'empty.txt' ) ;
29
29
30
30
fs . open ( emptyFile , 'r' , common . mustCall ( ( error , fd ) => {
31
+
31
32
assert . ifError ( error ) ;
32
33
33
- const read = fs . createReadStream ( emptyFile , { 'fd' : fd } ) ;
34
+ const read = fs . createReadStream ( emptyFile , { fd } ) ;
34
35
35
36
read . once ( 'data' , ( ) => {
36
- throw new Error ( 'data event should not emit' ) ;
37
+ common . fail ( 'data event should not emit' ) ;
37
38
} ) ;
38
39
39
40
read . once ( 'end' , common . mustCall ( function endEvent1 ( ) { } ) ) ;
40
41
} ) ) ;
41
42
42
43
fs . open ( emptyFile , 'r' , common . mustCall ( ( error , fd ) => {
44
+
43
45
assert . ifError ( error ) ;
44
46
45
- const read = fs . createReadStream ( emptyFile , { 'fd' : fd } ) ;
47
+ const read = fs . createReadStream ( emptyFile , { fd } ) ;
48
+
46
49
read . pause ( ) ;
47
50
48
51
read . once ( 'data' , ( ) => {
49
- throw new Error ( 'data event should not emit' ) ;
52
+ common . fail ( 'data event should not emit' ) ;
50
53
} ) ;
51
54
52
55
read . once ( 'end' , function endEvent2 ( ) {
53
- throw new Error ( 'end event should not emit' ) ;
56
+ common . fail ( 'end event should not emit' ) ;
54
57
} ) ;
55
58
56
59
setTimeout ( common . mustCall ( ( ) => {
0 commit comments