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

Function runErrorSubprocess

test/helpers/verbose.js:10–18  ·  view source on GitHub ↗
(t, verbose, isSync = false, expectExitCode = true)

Source from the content-addressed store, hash-verified

8export const QUOTE = isWindows ? '"' : '\'';
9
10export const runErrorSubprocess = async (t, verbose, isSync = false, expectExitCode = true) => {
11 const {stderr, nestedResult} = await nestedSubprocess('noop-fail.js', ['1', foobarString], {verbose, isSync});
12 t.true(nestedResult instanceof Error);
13 if (expectExitCode) {
14 t.true(stderr.includes('exit code 2'));
15 }
16
17 return stderr;
18};
19
20export const runWarningSubprocess = async (t, isSync) => {
21 const {stderr, nestedResult} = await nestedSubprocess('noop-fail.js', ['1', foobarString], {verbose: 'short', reject: false, isSync});

Callers 6

testPrintErrorFunction · 0.90
testPrintCommandErrorFunction · 0.90
testPrintErrorFunction · 0.90
testNoPrintErrorFunction · 0.90
error.jsFile · 0.90
testPrintCompletionErrorFunction · 0.90

Calls 1

nestedSubprocessFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…