@@ -7,29 +7,32 @@ const fs = require('fs');
7
7
const emptyFile = path . join ( common . fixturesDir , 'empty.txt' ) ;
8
8
9
9
fs . open ( emptyFile , 'r' , common . mustCall ( ( error , fd ) => {
10
+
10
11
assert . ifError ( error ) ;
11
12
12
- const read = fs . createReadStream ( emptyFile , { 'fd' : fd } ) ;
13
+ const read = fs . createReadStream ( emptyFile , { fd } ) ;
13
14
14
15
read . once ( 'data' , ( ) => {
15
- throw new Error ( 'data event should not emit' ) ;
16
+ common . fail ( 'data event should not emit' ) ;
16
17
} ) ;
17
18
18
19
read . once ( 'end' , common . mustCall ( function endEvent1 ( ) { } ) ) ;
19
20
} ) ) ;
20
21
21
22
fs . open ( emptyFile , 'r' , common . mustCall ( ( error , fd ) => {
23
+
22
24
assert . ifError ( error ) ;
23
25
24
- const read = fs . createReadStream ( emptyFile , { 'fd' : fd } ) ;
26
+ const read = fs . createReadStream ( emptyFile , { fd } ) ;
27
+
25
28
read . pause ( ) ;
26
29
27
30
read . once ( 'data' , ( ) => {
28
- throw new Error ( 'data event should not emit' ) ;
31
+ common . fail ( 'data event should not emit' ) ;
29
32
} ) ;
30
33
31
34
read . once ( 'end' , function endEvent2 ( ) {
32
- throw new Error ( 'end event should not emit' ) ;
35
+ common . fail ( 'end event should not emit' ) ;
33
36
} ) ;
34
37
35
38
setTimeout ( common . mustCall ( ( ) => {
0 commit comments