Content-Length: 299492 | pFad | https://github.com/nodejs/node/commit/c062ffc242

20 test: add coverage for pipeline · nodejs/node@c062ffc · GitHub
Skip to content

Commit c062ffc

Browse files
jakecastellijazelly
authored andcommitted
test: add coverage for pipeline
co-authored-by: jazelly <xzha4350@gmail.com> PR-URL: #56278 Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
1 parent d4404f0 commit c062ffc

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

test/parallel/test-stream-pipeline.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1723,3 +1723,30 @@ tmpdir.refresh();
17231723
});
17241724
src.destroy(new Error('problem'));
17251725
}
1726+
1727+
{
1728+
async function* myAsyncGenerator(ag) {
1729+
for await (const data of ag) {
1730+
yield data;
1731+
}
1732+
}
1733+
1734+
const duplexStream = Duplex.from(myAsyncGenerator);
1735+
1736+
const r = new Readable({
1737+
read() {
1738+
this.push('data1\n');
1739+
throw new Error('booom');
1740+
},
1741+
});
1742+
1743+
const w = new Writable({
1744+
write(chunk, encoding, callback) {
1745+
callback();
1746+
},
1747+
});
1748+
1749+
pipeline(r, duplexStream, w, common.mustCall((err) => {
1750+
assert.deepStrictEqual(err, new Error('booom'));
1751+
}));
1752+
}

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/nodejs/node/commit/c062ffc242

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy