Add descriptions for demux and compose

This commit is contained in:
Jerry Kurian
2019-09-09 15:54:29 -04:00
parent d33d8dcad3
commit 7aeea4815a
5 changed files with 60 additions and 134 deletions

View File

@@ -212,7 +212,8 @@ test("compose() should emit drain event ~rate * highWaterMark ms for every write
});
composed.on("data", (chunk: Chunk) => {
if (chunk.key === "e") {
pendingReads--;
if (pendingReads === 0) {
resolve();
}
});
@@ -226,6 +227,7 @@ test("compose() should emit drain event ~rate * highWaterMark ms for every write
];
let start = performance.now();
let pendingReads = input.length;
for (const item of input) {
const res = composed.write(item);
expect(composed._writableState.length).to.be.at.most(2);