File tree 1 file changed +25
-2
lines changed
1 file changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,31 @@ const fs = require('fs');
6
6
const tmpdir = require ( '../common/tmpdir' ) ;
7
7
tmpdir . refresh ( ) ;
8
8
9
- test ( fs . createReadStream ( __filename ) ) ;
10
- test ( fs . createWriteStream ( `${ tmpdir . path } /dummy` ) ) ;
9
+ {
10
+ const stream = fs . createReadStream ( __filename ) ;
11
+ stream . on ( 'close' , common . mustNotCall ( ) ) ;
12
+ test ( stream ) ;
13
+ }
14
+
15
+ {
16
+ const stream = fs . createWriteStream ( `${ tmpdir . path } /dummy` ) ;
17
+ stream . on ( 'close' , common . mustNotCall ( ) ) ;
18
+ test ( stream ) ;
19
+ }
20
+
21
+ {
22
+ const stream = fs . createReadStream ( __filename , { emitClose : true } ) ;
23
+ stream . on ( 'close' , common . mustCall ( ) ) ;
24
+ test ( stream ) ;
25
+ }
26
+
27
+ {
28
+ const stream = fs . createWriteStream ( `${ tmpdir . path } /dummy2` ,
29
+ { emitClose : true } ) ;
30
+ stream . on ( 'close' , common . mustCall ( ) ) ;
31
+ test ( stream ) ;
32
+ }
33
+
11
34
12
35
function test ( stream ) {
13
36
const err = new Error ( 'DESTROYED' ) ;
You can’t perform that action at this time.
0 commit comments