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

Function assertPromiseError

test/helpers/convert.js:62–72  ·  view source on GitHub ↗
(t, promise, error)

Source from the content-addressed store, hash-verified

60export const assertSubprocessError = (t, subprocess, error) => assertPromiseError(t, subprocess, error);
61
62export const assertPromiseError = async (t, promise, error) => {
63 const thrownError = await t.throwsAsync(promise);
64
65 if (isPlainObj(error) && error.cause !== undefined) {
66 t.is(thrownError.cause, error.cause);
67 } else {
68 t.is(thrownError, error);
69 }
70
71 return thrownError;
72};
73
74export const getReadableSubprocess = (output = foobarString, options = {}) => execa('noop-fd.js', ['1', output], options);
75

Callers 6

writable.jsFile · 0.90
duplex.jsFile · 0.90
readable.jsFile · 0.90
assertStreamErrorFunction · 0.85
assertStreamReadErrorFunction · 0.85
assertSubprocessErrorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…