Skip to content
Myr

Add more error handling related tests (#773)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by ehmicky · committed by GitHub · parent 8312453 · Browse files · 2 files+27 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+27 added−3 removed

  • tests:+27 added−3 removed

2 files+27 added−3 removed

modified:test/stdio/array.js+9 added
249 unmodified lines
250test('Does not destroy process.stdin on child process errors', testDestroyStandard, 0);251test('Does not destroy process.stdout on child process errors', testDestroyStandard, 1);252test('Does not destroy process.stderr on child process errors', testDestroyStandard, 2);253254const testDestroyStandardSpawn = async (t, index) => {255 await t.throwsAsync(execa('forever.js', {...getStdio(index, [STANDARD_STREAMS[index], 'pipe']), uid: -1}));256 t.false(STANDARD_STREAMS[index].destroyed);257};258259test('Does not destroy process.stdin on spawn process errors', testDestroyStandardSpawn, 0);260test('Does not destroy process.stdout on spawn process errors', testDestroyStandardSpawn, 1);261test('Does not destroy process.stderr on spawn process errors', testDestroyStandardSpawn, 2);262263const testDestroyStandardStream = async (t, index) => {264 const childProcess = execa('forever.js', getStdio(index, [STANDARD_STREAMS[index], 'pipe']));265 const error = new Error('test');266 childProcess.stdio[index].destroy(error);
8 unmodified lines
modified:test/stdio/web-stream.js+18 added-3 removed