Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9405cdd

Browse filesBrowse files
lpincacodebytere
authored andcommitted
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: #36056 Refs: #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>
1 parent 1550073 commit 9405cdd
Copy full SHA for 9405cdd

File tree

Expand file treeCollapse file tree

1 file changed

+5
-8
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-8
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-stream-duplex-readable-end.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-stream-duplex-readable-end.js
+5-8Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22
// https://github.com/nodejs/node/issues/35926
3-
require('../common');
3+
const common = require('../common');
44
const assert = require('assert');
55
const stream = require('stream');
66

@@ -22,11 +22,8 @@ const dst = new stream.Transform({
2222

2323
src.pipe(dst);
2424

25-
function parser_end() {
26-
assert.ok(loops > 0);
27-
dst.removeAllListeners();
28-
}
29-
3025
dst.on('data', () => { });
31-
dst.on('end', parser_end);
32-
dst.on('error', parser_end);
26+
dst.on('end', common.mustCall(() => {
27+
assert.strictEqual(loops, 3);
28+
assert.ok(src.isPaused());
29+
}));

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.