Skip to content

Commit 39b0c46

Browse files
committed
TEST: added agent and header tests
1 parent a350fad commit 39b0c46

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

Diff for: test/lib-caronte-common-test.js

+13-3
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ describe('lib/caronte/common.js', function () {
1313
hostname : 'how',
1414
socketPath: 'are',
1515
port : 'you',
16-
}
16+
},
17+
headers: {'fizz': 'bang', 'overwritten':true},
1718
},
1819
{
1920
method : 'i',
2021
url : 'am',
21-
headers : 'proxy'
22+
headers : {'pro':'xy','overwritten':false}
2223
});
2324

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

3031
expect(outgoing.method).to.eql('i');
3132
expect(outgoing.path).to.eql('am');
32-
expect(outgoing.headers).to.eql('proxy')
33+
34+
expect(outgoing.headers.pro).to.eql('xy');
35+
expect(outgoing.headers.fizz).to.eql('bang');
36+
expect(outgoing.headers.overwritten).to.eql(true);
37+
});
38+
39+
it('should set the agent to false if none is given', function () {
40+
var outgoing = {};
41+
common.setupOutgoing(outgoing, {target: {},}, {});
42+
expect(outgoing.agent).to.eql(false);
3343
});
3444

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

0 commit comments

Comments
 (0)