We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1550073 commit 9405cddCopy full SHA for 9405cdd
test/parallel/test-stream-duplex-readable-end.js
@@ -1,6 +1,6 @@
1
'use strict';
2
// https://github.com/nodejs/node/issues/35926
3
-require('../common');
+const common = require('../common');
4
const assert = require('assert');
5
const stream = require('stream');
6
@@ -22,11 +22,8 @@ const dst = new stream.Transform({
22
23
src.pipe(dst);
24
25
-function parser_end() {
26
- assert.ok(loops > 0);
27
- dst.removeAllListeners();
28
-}
29
-
30
dst.on('data', () => { });
31
-dst.on('end', parser_end);
32
-dst.on('error', parser_end);
+dst.on('end', common.mustCall(() => {
+ assert.strictEqual(loops, 3);
+ assert.ok(src.isPaused());
+}));
0 commit comments