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

Function assertFileStreamError

test/stdio/node-stream-native.js:75–85  ·  view source on GitHub ↗
(t, subprocess, stream, filePath)

Source from the content-addressed store, hash-verified

73};
74
75const assertFileStreamError = async (t, subprocess, stream, filePath) => {
76 const cause = new Error('test');
77 stream.destroy(cause);
78
79 const error = await t.throwsAsync(subprocess);
80 t.is(error.cause, cause);
81 t.is(error.exitCode, 0);
82 t.is(error.signal, undefined);
83
84 await rm(filePath);
85};
86
87const testFileReadable = async (t, fdNumber, execaMethod) => {
88 const {stream, filePath} = await createFileReadStream();

Callers 2

testFileReadableErrorFunction · 0.85
testFileWritableErrorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected