MCPcopy Index your code
hub / github.com/nodejs/node / testWriteAfterFail

Function testWriteAfterFail

test/parallel/test-stream-iter-push-writer.js:195–205  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

193}
194
195async function testWriteAfterFail() {
196 const { writer } = push();
197 writer.fail(new Error('failed'));
198 // Sync write after fail returns false
199 assert.strictEqual(writer.writeSync('fail'), false);
200 // Async write after fail rejects with the stored error
201 await assert.rejects(
202 () => writer.write('fail'),
203 { message: 'failed' },
204 );
205}
206
207async function testFail() {
208 const { writer, readable } = push();

Callers 1

Calls 4

pushFunction · 0.70
failMethod · 0.45
writeSyncMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…