MCPcopy
hub / github.com/sindresorhus/execa / testSubprocessFail

Function testSubprocessFail

test/convert/shared.js:15–28  ·  view source on GitHub ↗
(t, methodName)

Source from the content-addressed store, hash-verified

13setFixtureDirectory();
14
15const testSubprocessFail = async (t, methodName) => {
16 const subprocess = getReadWriteSubprocess();
17 const stream = subprocess[methodName]();
18
19 const cause = new Error(foobarString);
20 subprocess.kill(cause);
21
22 const error = await assertStreamError(t, stream, {cause});
23 assertWritableAborted(t, subprocess.stdin);
24 t.true(subprocess.stdout.readableEnded);
25 t.true(subprocess.stderr.readableEnded);
26
27 await assertSubprocessError(t, subprocess, error);
28};
29
30test('subprocess fail -> .readable() error', testSubprocessFail, 'readable');
31test('subprocess fail -> .writable() error', testSubprocessFail, 'writable');

Callers

nothing calls this directly

Calls 4

getReadWriteSubprocessFunction · 0.90
assertStreamErrorFunction · 0.90
assertWritableAbortedFunction · 0.90
assertSubprocessErrorFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…