aboutsummaryrefslogtreecommitdiff
path: root/test/parallel/test-readable-single-end.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/parallel/test-readable-single-end.js')
-rw-r--r--test/parallel/test-readable-single-end.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/parallel/test-readable-single-end.js b/test/parallel/test-readable-single-end.js
new file mode 100644
index 0000000000..0969d49aa4
--- /dev/null
+++ b/test/parallel/test-readable-single-end.js
@@ -0,0 +1,16 @@
+'use strict';
+
+const common = require('../common');
+const { Readable } = require('stream');
+
+// This test ensures that there will not be an additional empty 'readable'
+// event when stream has ended (only 1 event signalling about end)
+
+const r = new Readable({
+ read: () => {},
+});
+
+r.push(null);
+
+r.on('readable', common.mustCall());
+r.on('end', common.mustCall());