diff options
Diffstat (limited to 'test/parallel/test-http-client-agent.js')
-rw-r--r-- | test/parallel/test-http-client-agent.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/test/parallel/test-http-client-agent.js b/test/parallel/test-http-client-agent.js index 8093100fce..3c2b9c8972 100644 --- a/test/parallel/test-http-client-agent.js +++ b/test/parallel/test-http-client-agent.js @@ -3,11 +3,11 @@ require('../common'); const assert = require('assert'); const http = require('http'); -var name; -var max = 3; -var count = 0; +let name; +const max = 3; +let count = 0; -var server = http.Server(function(req, res) { +const server = http.Server(function(req, res) { if (req.url === '/0') { setTimeout(function() { res.writeHead(200); @@ -20,17 +20,17 @@ var server = http.Server(function(req, res) { }); server.listen(0, function() { name = http.globalAgent.getName({ port: this.address().port }); - for (var i = 0; i < max; ++i) { + for (let i = 0; i < max; ++i) { request(i); } }); function request(i) { - var req = http.get({ + const req = http.get({ port: server.address().port, path: '/' + i }, function(res) { - var socket = req.socket; + const socket = req.socket; socket.on('close', function() { ++count; if (count < max) { |