diff --git a/test/unit/test_http_connector.js b/test/unit/test_http_connector.js index 0710c8436..851de995c 100644 --- a/test/unit/test_http_connector.js +++ b/test/unit/test_http_connector.js @@ -8,6 +8,7 @@ describe('Http Connector', function () { var nock = require('nock'); var sinon = require('sinon'); var util = require('util'); + var KeepAliveAgent = require('agentkeepalive'); var http = require('http'); var https = require('https'); @@ -55,7 +56,7 @@ describe('Http Connector', function () { // requestTimeout }); - it('expects one the host to have a protocol of http or https', function () { + it('expects the host to have a protocol of http or https', function () { (function () { var con = new HttpConnection(new Host('thrifty://es.com/stuff')); }).should.throw(/invalid protocol/i); @@ -175,6 +176,7 @@ describe('Http Connector', function () { con.request({}, function () { http.request.callCount.should.eql(1); https.request.callCount.should.eql(0); + http.request.lastCall.args[0].agent.should.be.an.instanceOf(KeepAliveAgent); done(); }); }); @@ -184,6 +186,7 @@ describe('Http Connector', function () { con.request({}, function () { http.request.callCount.should.eql(0); https.request.callCount.should.eql(1); + https.request.lastCall.args[0].agent.should.be.an.instanceOf(KeepAliveAgent.HttpsAgent); done(); }); });