add some tests to make sure the createNodeAgent config works

This commit is contained in:
spalger
2016-01-05 10:09:13 -07:00
parent 8bed4a85ec
commit 04dfa9deef

View File

@ -64,6 +64,17 @@ describe('Http Connector', function () {
var con = new HttpConnection(new Host('thrifty://es.com/stuff'));
}).to.throwError(/invalid protocol/i);
});
it('allows defining a custom agent', function () {
var football = {};
var con = new HttpConnection(new Host(), { createNodeAgent: _.constant(football) });
expect(con.agent).to.be(football);
});
it('allows setting agent to false', function () {
var con = new HttpConnection(new Host(), { createNodeAgent: _.constant(false) });
expect(con.agent).to.be(false);
});
});
describe('#makeReqParams', function () {