Skip to content

Commit

Permalink
stream: add test for multiple .push(null)
Browse files Browse the repository at this point in the history
PR-URL: #29645
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
ckarande authored and BridgeAR committed Sep 25, 2019
1 parent b100897 commit f016823
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/parallel/test-stream-readable-ended.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,16 @@ const assert = require('assert');
assert.strictEqual(readable.readableEnded, false);
}));
}

// Verifies no `error` triggered on multiple .push(null) invocations
{
const readable = new Readable();

readable.on('readable', () => { readable.read(); });
readable.on('error', common.mustNotCall());
readable.on('end', common.mustCall());

readable.push('a');
readable.push(null);
readable.push(null);
}

0 comments on commit f016823

Please sign in to comment.