summaryrefslogtreecommitdiff
path: root/test/parallel/test-http-outgoing-finish-writable.js
diff options
context:
space:
mode:
authorRobert Nagy <ronagy@icloud.com>2019-08-02 08:09:06 +0200
committerRich Trott <rtrott@gmail.com>2019-08-17 00:28:06 -0700
commit6f613d8abb05619e35c828b665a76215861bbf04 (patch)
tree18a904d44299c6564c5c83adc0051076f27bb922 /test/parallel/test-http-outgoing-finish-writable.js
parente4bbbcc84bd10be1e9e8e66d42542c70c1a02056 (diff)
downloadandroid-node-v8-6f613d8abb05619e35c828b665a76215861bbf04.tar.gz
android-node-v8-6f613d8abb05619e35c828b665a76215861bbf04.tar.bz2
android-node-v8-6f613d8abb05619e35c828b665a76215861bbf04.zip
http,stream: add writableEnded
This is work towards resolving the response.finished confusion and future deprecation. Note that implementation-wise, streams have both an ending and ended state. However, in this case (in order to avoid confusion in user space) writableEnded is equal to writable.ending. The ending vs ended situation is internal state required for internal stream logic. PR-URL: https://github.com/nodejs/node/pull/28934 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'test/parallel/test-http-outgoing-finish-writable.js')
-rw-r--r--test/parallel/test-http-outgoing-finish-writable.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/parallel/test-http-outgoing-finish-writable.js b/test/parallel/test-http-outgoing-finish-writable.js
index e03901fb6d..e3c870164b 100644
--- a/test/parallel/test-http-outgoing-finish-writable.js
+++ b/test/parallel/test-http-outgoing-finish-writable.js
@@ -9,12 +9,14 @@ const http = require('http');
const server = http.createServer(common.mustCall(function(req, res) {
assert.strictEqual(res.writable, true);
assert.strictEqual(res.finished, false);
+ assert.strictEqual(res.writableEnded, false);
res.end();
// res.writable is set to false after it has finished sending
// Ref: https://github.com/nodejs/node/issues/15029
assert.strictEqual(res.writable, true);
assert.strictEqual(res.finished, true);
+ assert.strictEqual(res.writableEnded, true);
server.close();
}));