Skip to content

Commit

Permalink
test: add arrayOfStreams to pipeline
Browse files Browse the repository at this point in the history
PR-URL: #34156
Backport-PR-URL: #35388
Reviewed-By: Robert Nagy <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
  • Loading branch information
rickyes authored and addaleax committed Sep 28, 2020
1 parent 05da376 commit 2f67e99
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/parallel/test-stream-pipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -518,3 +518,23 @@ const { promisify } = require('util');
}).on('error', common.mustNotCall());
});
}

{
const r = new Readable({
read() {}
});
r.push('hello');
r.push('world');
r.push(null);
let res = '';
const w = new Writable({
write(chunk, encoding, callback) {
res += chunk;
callback();
}
});
pipeline([r, w], common.mustCall((err) => {
assert.ok(!err);
assert.strictEqual(res, 'helloworld');
}));
}

0 comments on commit 2f67e99

Please sign in to comment.