Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c062ffc

Browse filesBrowse 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
Copy full SHA for c062ffc

File tree

Expand file treeCollapse file tree

1 file changed

+27
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+27
-0
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-stream-pipeline.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-stream-pipeline.js
+27Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.