summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRobert Nagy <ronagy@icloud.com>2018-04-26 09:53:54 +0200
committerVse Mozhet Byt <vsemozhetbyt@gmail.com>2018-05-14 23:05:09 +0300
commit4b00c4fafaa2ae8c41c1f78823c0feb810ae4723 (patch)
treee169a5ced04f231f4a11c02d4602a2cb426200a3 /test
parent50b334befd494546faca720e541ea88f7553731c (diff)
downloadandroid-node-v8-4b00c4fafaa2ae8c41c1f78823c0feb810ae4723.tar.gz
android-node-v8-4b00c4fafaa2ae8c41c1f78823c0feb810ae4723.tar.bz2
android-node-v8-4b00c4fafaa2ae8c41c1f78823c0feb810ae4723.zip
http: make client `.aborted` boolean
PR-URL: https://github.com/nodejs/node/pull/20230 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-http-abort-stream-end.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/test/parallel/test-http-abort-stream-end.js b/test/parallel/test-http-abort-stream-end.js
index 8d2704a1ee..04c4062faa 100644
--- a/test/parallel/test-http-abort-stream-end.js
+++ b/test/parallel/test-http-abort-stream-end.js
@@ -38,21 +38,20 @@ const server = http.createServer(common.mustCall((req, res) => {
res.end();
}));
-let aborted = false;
server.listen(0, () => {
-
const res = common.mustCall((res) => {
res.on('data', (chunk) => {
size += chunk.length;
- assert(!aborted, 'got data after abort');
+ assert(!req.aborted, 'got data after abort');
if (size > maxSize) {
- aborted = true;
req.abort();
+ assert.strictEqual(req.aborted, true);
size = maxSize;
}
});
req.on('abort', common.mustCall(() => assert.strictEqual(size, maxSize)));
+ assert.strictEqual(req.aborted, false);
});
const req = http.get(`http://localhost:${server.address().port}`, res);