summaryrefslogtreecommitdiff
path: root/test/parallel/test-stream-finished.js
diff options
context:
space:
mode:
authorRobert Nagy <ronagy@icloud.com>2021-11-26 18:33:05 +0100
committerGitHub <noreply@github.com>2021-11-26 17:33:05 +0000
commit49b8c4f08b8961a61619043d80cc514474f3123d (patch)
tree153d7d1f069188ef1722ace01cdb98576b77f76f /test/parallel/test-stream-finished.js
parent43e127801425d0ddb1b23b86c3788603d00d6da3 (diff)
downloadnode-new-49b8c4f08b8961a61619043d80cc514474f3123d.tar.gz
stream: stricter isReadableNodeStream
Fixes: https://github.com/nodejs/node/issues/40938 PR-URL: https://github.com/nodejs/node/pull/40941 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test/parallel/test-stream-finished.js')
-rw-r--r--test/parallel/test-stream-finished.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/parallel/test-stream-finished.js b/test/parallel/test-stream-finished.js
index 51838a382e..b05b8c5421 100644
--- a/test/parallel/test-stream-finished.js
+++ b/test/parallel/test-stream-finished.js
@@ -643,3 +643,20 @@ testClosed((opts) => new Writable({ write() {}, ...opts }));
const s = new Stream();
finished(s, common.mustNotCall());
}
+
+{
+ const server = http.createServer(common.mustCall(function(req, res) {
+ fs.createReadStream(__filename).pipe(res);
+ finished(res, common.mustCall(function(err) {
+ assert.strictEqual(err, undefined);
+ }));
+ })).listen(0, function() {
+ http.request(
+ { method: 'GET', port: this.address().port },
+ common.mustCall(function(res) {
+ res.resume();
+ server.close();
+ })
+ ).end();
+ });
+}