File tree Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Original file line number Diff line number Diff line change 11'use strict' ;
2- require ( '../common' ) ;
2+ const { mustCall } = require ( '../common' ) ;
33const assert = require ( 'assert' ) ;
4- const spawn = require ( 'child_process' ) . spawn ;
4+ const { spawn } = require ( 'child_process' ) ;
55
66const cat = spawn ( 'cat' ) ;
7- let called ;
87
98assert . ok ( process . kill ( cat . pid , 0 ) ) ;
109
11- cat . on ( 'exit' , function ( ) {
10+ cat . on ( 'exit' , mustCall ( function ( ) {
1211 assert . throws ( function ( ) {
1312 process . kill ( cat . pid , 0 ) ;
1413 } , Error ) ;
15- } ) ;
14+ } ) ) ;
1615
17- cat . stdout . on ( 'data' , function ( ) {
18- called = true ;
16+ cat . stdout . on ( 'data' , mustCall ( function ( ) {
1917 process . kill ( cat . pid , 'SIGKILL' ) ;
20- } ) ;
18+ } ) ) ;
2119
2220// EPIPE when null sig fails
2321cat . stdin . write ( 'test' ) ;
24-
25- process . on ( 'exit' , function ( ) {
26- assert . ok ( called ) ;
27- } ) ;
You can’t perform that action at this time.
0 commit comments