Skip to content

Commit

Permalink
[test] add test for prependPath option
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrugzz committed Sep 11, 2014
1 parent 9a534c6 commit e44fabe
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions test/lib-http-proxy-common-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('lib/http-proxy/common.js', function () {
{
method : 'i',
url : 'am',
headers : {'pro':'xy','overwritten':false}
headers : {'pro':'xy','overwritten':false}
});

expect(outgoing.host).to.eql('hey');
Expand Down Expand Up @@ -91,7 +91,7 @@ describe('lib/http-proxy/common.js', function () {
it('set the port according to the protocol', function () {
var outgoing = {};
common.setupOutgoing(outgoing,
{
{
agent : '?',
target: {
host : 'how',
Expand All @@ -103,7 +103,7 @@ describe('lib/http-proxy/common.js', function () {
{
method : 'i',
url : 'am',
headers : 'proxy'
headers : 'proxy'
});

expect(outgoing.host).to.eql('how');
Expand Down Expand Up @@ -140,6 +140,16 @@ describe('lib/http-proxy/common.js', function () {

expect(outgoing.path).to.eql('some-path/am');
});

it('should not prepend the target path to the outgoing path with prependPath = false', function () {
var outgoing = {};
common.setupOutgoing(outgoing, {
target: { path: 'hellothere' },
prependPath: false
}, { url: 'hi' });

expect(outgoing.path).to.eql('hi');
})
});

describe('#setupSocket', function () {
Expand Down

0 comments on commit e44fabe

Please sign in to comment.