Skip to content

Commit f016823

Browse files
ckarandeBridgeAR
authored andcommitted
stream: add test for multiple .push(null)
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]>
1 parent b100897 commit f016823

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/parallel/test-stream-readable-ended.js

+13
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,16 @@ const assert = require('assert');
3131
assert.strictEqual(readable.readableEnded, false);
3232
}));
3333
}
34+
35+
// Verifies no `error` triggered on multiple .push(null) invocations
36+
{
37+
const readable = new Readable();
38+
39+
readable.on('readable', () => { readable.read(); });
40+
readable.on('error', common.mustNotCall());
41+
readable.on('end', common.mustCall());
42+
43+
readable.push('a');
44+
readable.push(null);
45+
readable.push(null);
46+
}

0 commit comments

Comments
 (0)