@@ -7,29 +7,32 @@ const fs = require('fs');
77const emptyFile = path . join ( common . fixturesDir , 'empty.txt' ) ;
88
99fs . open ( emptyFile , 'r' , common . mustCall ( ( error , fd ) => {
10+
1011 assert . ifError ( error ) ;
1112
12- const read = fs . createReadStream ( emptyFile , { 'fd' : fd } ) ;
13+ const read = fs . createReadStream ( emptyFile , { fd } ) ;
1314
1415 read . once ( 'data' , ( ) => {
15- throw new Error ( 'data event should not emit' ) ;
16+ common . fail ( 'data event should not emit' ) ;
1617 } ) ;
1718
1819 read . once ( 'end' , common . mustCall ( function endEvent1 ( ) { } ) ) ;
1920} ) ) ;
2021
2122fs . open ( emptyFile , 'r' , common . mustCall ( ( error , fd ) => {
23+
2224 assert . ifError ( error ) ;
2325
24- const read = fs . createReadStream ( emptyFile , { 'fd' : fd } ) ;
26+ const read = fs . createReadStream ( emptyFile , { fd } ) ;
27+
2528 read . pause ( ) ;
2629
2730 read . once ( 'data' , ( ) => {
28- throw new Error ( 'data event should not emit' ) ;
31+ common . fail ( 'data event should not emit' ) ;
2932 } ) ;
3033
3134 read . once ( 'end' , function endEvent2 ( ) {
32- throw new Error ( 'end event should not emit' ) ;
35+ common . fail ( 'end event should not emit' ) ;
3336 } ) ;
3437
3538 setTimeout ( common . mustCall ( ( ) => {
0 commit comments