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

Function testErrorPropagation

test/parallel/test-stream-iter-readable-interop.js:174–185  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

172// =============================================================================
173
174async function testErrorPropagation() {
175 const readable = new Readable({
176 read() {
177 process.nextTick(() => this.destroy(new Error('test error')));
178 },
179 });
180
181 await assert.rejects(
182 text(from(readable)),
183 (err) => err.message === 'test error',
184 );
185}
186
187// =============================================================================
188// Byte-mode Readable: with transforms

Calls 2

textFunction · 0.50
fromFunction · 0.50

Tested by

no test coverage detected