MCPcopy Create free account
hub / github.com/sindresorhus/execa / testStreamInputError

Function testStreamInputError

test/resolve/stdio.js:85–94  ·  view source on GitHub ↗
(t, fdNumber)

Source from the content-addressed store, hash-verified

83test('Destroying output stdio[*] should not make the subprocess exit', testStreamOutputDestroy, 3);
84
85const testStreamInputError = async (t, fdNumber) => {
86 const subprocess = getStreamInputSubprocess(fdNumber);
87 const cause = new Error('test');
88 const stream = subprocess.stdio[fdNumber];
89 stream.emit('error', cause);
90 stream.end();
91 const error = await t.throwsAsync(subprocess);
92 t.is(error.cause, cause);
93 assertStreamInputError(t, error);
94};
95
96test('Errors on stdin should not make the subprocess exit', testStreamInputError, 0);
97test('Errors on input stdio[*] should not make the subprocess exit', testStreamInputError, 3);

Callers

nothing calls this directly

Calls 2

getStreamInputSubprocessFunction · 0.85
assertStreamInputErrorFunction · 0.85

Tested by

no test coverage detected