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

Function assertUnhandledPipePromise

test/pipe/sequence.js:34–46  ·  view source on GitHub ↗
(t, {destinationOptions = {}, inspectPipePromise} = {})

Source from the content-addressed store, hash-verified

32};
33
34const assertUnhandledPipePromise = async (t, {destinationOptions = {}, inspectPipePromise} = {}) => {
35 const source = execa('fail.js');
36 const destination = execa('fail.js', destinationOptions);
37 const pipePromise = source.pipe(destination);
38 const unhandledRejectionPromise = once(process, 'unhandledRejection');
39 await inspectPipePromise?.(pipePromise);
40 await assertUnhandledRejection(t, pipePromise, unhandledRejectionPromise);
41 await Promise.all([
42 t.throwsAsync(source),
43 t.throwsAsync(destination),
44 ]);
45 await t.throwsAsync(pipePromise);
46};
47
48test('Source stream abort -> destination success', async t => {
49 const source = execa('noop-repeat.js');

Callers 1

sequence.jsFile · 0.85

Calls 2

inspectPipePromiseFunction · 0.85
assertUnhandledRejectionFunction · 0.85

Tested by

no test coverage detected