aboutsummaryrefslogtreecommitdiff
path: root/test/parallel/test-stream-finished.js
AgeCommit message (Collapse)Author
2019-10-10Revert "stream: make finished call the callback if the stream is closed"Matteo Collina
This reverts commit b03845b9376aec590b89f753a4b7c1b47729c5f8. PR-URL: https://github.com/nodejs/node/pull/29717 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
2019-09-22stream: use more accurate end-of-stream writable and readable detectionRobert Nagy
The value of stream.readable and stream.writable should not be used to detect whether a stream is Writable or Readable. Refs: https://github.com/nodejs/node/issues/29395 PR-URL: https://github.com/nodejs/node/pull/29409 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-09-03stream: make finished call the callback if the stream is closedRobert Nagy
Make stream.finished callback invoked if stream is already closed/destroyed. PR-URL: https://github.com/nodejs/node/pull/28748 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2019-08-19stream: add readableEndedRobert Nagy
Adds a readableEnded property and improved finished compat with possible stream-like objects. PR-URL: https://github.com/nodejs/node/pull/28814 Refs: https://github.com/nodejs/node/issues/28813 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-03-27benchmark,doc,lib: capitalize more commentsRuben Bridgewater
PR-URL: https://github.com/nodejs/node/pull/26849 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2019-03-23errors: update error nameRuben Bridgewater
This updates all Node.js errors by removing the `code` being part of the `name` property. Instead, the name is just changed once on instantiation, the stack is accessed to create the stack as expected and then the `name` property is set back to it's original form. PR-URL: https://github.com/nodejs/node/pull/26738 Fixes: https://github.com/nodejs/node/issues/26669 Fixes: https://github.com/nodejs/node/issues/20253 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2018-10-24test: increase coverage of internal/stream/end-of-streamTyler Vann-Campbell
This change adds test cases to call the function returned by end-of-stream and asserts that callbacks are not called when the stream is ended, or prematurely closed. PR-URL: https://github.com/nodejs/node/pull/23751 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-08-22lib: require a callback for end-of-streamRuben Bridgewater
Make the callback mandatory as mostly done in all other Node.js callback APIs so users explicitly have to decide what to do in error cases. This also documents the options for `Stream.finished()`. When originally implemented it was missed that Stream.finished() has an optional options object. PR-URL: https://github.com/nodejs/node/pull/21058 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Mathias Buus <mathiasbuus@gmail.com>
2018-07-19test: make crashOnUnhandleRejection opt-outMichaël Zasso
This commit removes `common.crashOnUnhandledRejection()` and adds `common.disableCrashOnUnhandledRejection()`. To reduce the risk of mistakes and make writing tests that involve promises simpler, always install the unhandledRejection hook in tests and provide a way to disable it for the rare cases where it's needed. PR-URL: https://github.com/nodejs/node/pull/21849 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-04-16stream: add pipeline and finishedMathias Buus
PR-URL: https://github.com/nodejs/node/pull/19828 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>