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 <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Yongsheng Zhang <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
  • Loading branch information
ckarande authored and danbev committed Sep 24, 2019
1 parent fed05cc commit e078e48
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 e078e48

Please sign in to comment.