mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
test: improve test-stream-duplex-readable-end
- Remove unneeded listener for the `'error'` event. - Use `common.mustCall()`. - Verify that the `src` stream gets paused. PR-URL: https://github.com/nodejs/node/pull/36056 Refs: https://github.com/nodejs/node/pull/35941 Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
This commit is contained in:
1 parent
22293eab48
commit
d5e4e19470
1 file changed
+5
-8
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
// https://github.com/nodejs/node/issues/35926
|
||||
require('../common');
|
||||
const common = require('../common');
|
||||
const assert = require('assert');
|
||||
const stream = require('stream');
|
||||
|
||||
@@ -22,11 +22,8 @@ const dst = new stream.Transform({
|
||||
|
||||
src.pipe(dst);
|
||||
|
||||
function parser_end() {
|
||||
assert.ok(loops > 0);
|
||||
dst.removeAllListeners();
|
||||
}
|
||||
|
||||
dst.on('data', () => { });
|
||||
dst.on('end', parser_end);
|
||||
dst.on('error', parser_end);
|
||||
dst.on('end', common.mustCall(() => {
|
||||
assert.strictEqual(loops, 3);
|
||||
assert.ok(src.isPaused());
|
||||
}));
|
||||
Reference in new issue
Block a user