Skip to content

Commit

Permalink
test: add arrayOfStreams to pipeline
Browse files Browse the repository at this point in the history
PR-URL: #34156
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
rickyes authored and MylesBorins committed Jul 14, 2020
1 parent 5687baf commit fe741ef
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 @@ -1211,3 +1211,23 @@ const net = require('net');
d.write('test');
d.end();
}

{
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 fe741ef

Please sign in to comment.