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 <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
  • Loading branch information
rickyes authored and MylesBorins committed Jul 16, 2020
1 parent 0f9bafd commit 38b3c2a
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 38b3c2a

Please sign in to comment.