Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test( 'returns non-zero exit code when child process errors', () => {
let b = {
add: jest.fn(),
bundle: jest.fn( cb => { cb( null, SRC ) } )
}
browserify.mockReturnValue( b );
let write = jest.fn();
let end = jest.fn();
let on = jest.fn();
on.mockReturnValueOnce( 1 );
on.mockReturnValueOnce( Error( 'an error occured while spawning the process') );
cp.spawn = jest.fn() ;
cp.spawn.mockReturnValue( {
stdin: { write, end },
on
})
nodeJxa( './example.js', { debug: true } );