We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d4404f0 commit c062ffcCopy full SHA for c062ffc
1 file changed
test/parallel/test-stream-pipeline.js
@@ -1723,3 +1723,30 @@ tmpdir.refresh();
1723
});
1724
src.destroy(new Error('problem'));
1725
}
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