stream: add test for multiple .push(null)
PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
parent
fed05cc414
commit
e078e482c5
@ -31,3 +31,16 @@ const assert = require('assert');
|
|||||||
assert.strictEqual(readable.readableEnded, false);
|
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);
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user