Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit dba0a8d

Browse files
committedSep 28, 2020
test: add arrayOfStreams to pipeline
PR-URL: nodejs#34156 Reviewed-By: Robert Nagy <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent fd881c7 commit dba0a8d

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
 

Diff for: ‎test/parallel/test-stream-pipeline.js

+20
Original file line numberDiff line numberDiff line change
@@ -518,3 +518,23 @@ const { promisify } = require('util');
518518
}).on('error', common.mustNotCall());
519519
});
520520
}
521+
522+
{
523+
const r = new Readable({
524+
read() {}
525+
});
526+
r.push('hello');
527+
r.push('world');
528+
r.push(null);
529+
let res = '';
530+
const w = new Writable({
531+
write(chunk, encoding, callback) {
532+
res += chunk;
533+
callback();
534+
}
535+
});
536+
pipeline([r, w], common.mustCall((err) => {
537+
assert.ok(!err);
538+
assert.strictEqual(res, 'helloworld');
539+
}));
540+
}

0 commit comments

Comments
 (0)
Please sign in to comment.