GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: increase coverage of internal/stream/end-of-stream · nodejs/node@086ee5e

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • test-stream-finished.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/parallel/test-stream-finished.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-stream-finished.js
+22Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,25 @@ const { promisify } = require('util');
153153
rs.push(null);
154154
rs.resume();
155155
}
156+
157+
// Test that calling returned function removes listeners
158+
{
159+
const ws = new Writable({
160+
write(data, env, cb) {
161+
cb();
162+
}
163+
});
164+
const removeListener = finished(ws, common.mustNotCall());
165+
removeListener();
166+
ws.end();
167+
}
168+
169+
{
170+
const rs = new Readable();
171+
const removeListeners = finished(rs, common.mustNotCall());
172+
removeListeners();
173+
174+
rs.emit('close');
175+
rs.push(null);
176+
rs.resume();
177+
}

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.