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

Function assertProcessError

test/transform/generator-error.js:12–21  ·  view source on GitHub ↗
(t, type, execaMethod, getSubprocess)

Source from the content-addressed store, hash-verified

10setFixtureDirectory();
11
12const assertProcessError = async (t, type, execaMethod, getSubprocess) => {
13 const cause = new Error(foobarString);
14 const transform = generatorsMap[type].throwing(cause)();
15 const error = execaMethod === execa
16 ? await t.throwsAsync(getSubprocess(transform))
17 : t.throws(() => {
18 getSubprocess(transform);
19 });
20 t.is(error.cause, cause);
21};
22
23const testThrowingGenerator = async (t, type, final, execaMethod) => {
24 await assertProcessError(t, type, execaMethod, transform => execaMethod('noop.js', {

Callers 3

testThrowingGeneratorFunction · 0.85
testSingleErrorOutputFunction · 0.85
testSingleErrorInputFunction · 0.85

Calls 1

getSubprocessFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…