diff options
author | James M Snell <jasnell@gmail.com> | 2017-07-14 15:05:24 -0700 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2017-07-24 14:16:49 -0700 |
commit | b0a8a7c6baccea746da10e01bfb3dec18c0d723e (patch) | |
tree | 3bdf54ff6e3daa9c6ac9816914c7a51b892021dd /test/parallel/test-http-agent-no-protocol.js | |
parent | ed21cb1774d3e146f84a94400db0008a940656c3 (diff) | |
download | android-node-v8-b0a8a7c6baccea746da10e01bfb3dec18c0d723e.tar.gz android-node-v8-b0a8a7c6baccea746da10e01bfb3dec18c0d723e.tar.bz2 android-node-v8-b0a8a7c6baccea746da10e01bfb3dec18c0d723e.zip |
test: improvements to various http tests
* Add common/countdown utility
* Numerous improvements to http tests
PR-URL: https://github.com/nodejs/node/pull/14315
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Diffstat (limited to 'test/parallel/test-http-agent-no-protocol.js')
-rw-r--r-- | test/parallel/test-http-agent-no-protocol.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/parallel/test-http-agent-no-protocol.js b/test/parallel/test-http-agent-no-protocol.js index 4630ef8ee6..b5a144abc9 100644 --- a/test/parallel/test-http-agent-no-protocol.js +++ b/test/parallel/test-http-agent-no-protocol.js @@ -24,17 +24,17 @@ const common = require('../common'); const http = require('http'); const url = require('url'); -const server = http.createServer(common.mustCall(function(req, res) { +const server = http.createServer(common.mustCall((req, res) => { res.end(); -})).listen(0, '127.0.0.1', common.mustCall(function() { - const opts = url.parse(`http://127.0.0.1:${this.address().port}/`); +})).listen(0, '127.0.0.1', common.mustCall(() => { + const opts = url.parse(`http://127.0.0.1:${server.address().port}/`); // remove the `protocol` field… the `http` module should fall back // to "http:", as defined by the global, default `http.Agent` instance. opts.agent = new http.Agent(); opts.agent.protocol = null; - http.get(opts, common.mustCall(function(res) { + http.get(opts, common.mustCall((res) => { res.resume(); server.close(); })); |