File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
functions/imagemagick/test Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -47,8 +47,16 @@ async function startFF(port) {
4747 let stderr = '' ;
4848 ffProc . stdout . on ( 'data' , data => ( stdout += data ) ) ;
4949 ffProc . stderr . on ( 'data' , data => ( stderr += data ) ) ;
50- ffProc . on ( 'error' , c => ( c === 0 ? resolve ( stdout ) : reject ( stderr ) ) ) ;
51- ffProc . on ( 'exit' , c => ( c === 0 ? resolve ( stdout ) : reject ( stderr ) ) ) ;
50+ ffProc . on ( 'exit' , code => {
51+ if ( code === 0 || code === null ) {
52+ // code === null corresponds to a signal-kill
53+ // (which doesn't necessarily indicate a test failure)
54+ resolve ( stdout ) ;
55+ } else {
56+ stderr = `Error code: ${ code } \n${ stderr } ` ;
57+ reject ( new Error ( stderr ) ) ;
58+ }
59+ } ) ;
5260 } ) ;
5361 await waitPort ( { host : 'localhost' , port} ) ;
5462 return { ffProc, ffProcHandler} ;
You can’t perform that action at this time.
0 commit comments