Skip to content

Commit

Permalink
TEST: added agent and header tests
Browse files Browse the repository at this point in the history
  • Loading branch information
srossross committed Sep 17, 2013
1 parent a350fad commit 39b0c46
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions test/lib-caronte-common-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ describe('lib/caronte/common.js', function () {
hostname : 'how',
socketPath: 'are',
port : 'you',
}
},
headers: {'fizz': 'bang', 'overwritten':true},
},
{
method : 'i',
url : 'am',
headers : 'proxy'
headers : {'pro':'xy','overwritten':false}
});

expect(outgoing.host).to.eql('hey');
Expand All @@ -29,7 +30,16 @@ describe('lib/caronte/common.js', function () {

expect(outgoing.method).to.eql('i');
expect(outgoing.path).to.eql('am');
expect(outgoing.headers).to.eql('proxy')

expect(outgoing.headers.pro).to.eql('xy');
expect(outgoing.headers.fizz).to.eql('bang');
expect(outgoing.headers.overwritten).to.eql(true);
});

it('should set the agent to false if none is given', function () {
var outgoing = {};
common.setupOutgoing(outgoing, {target: {},}, {});
expect(outgoing.agent).to.eql(false);
});

it('set the port according to the protocol', function () {
Expand Down

0 comments on commit 39b0c46

Please sign in to comment.