Skip to content

Commit

Permalink
[test] add proper failing test case for #738
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrugzz committed Dec 2, 2014
1 parent d98d951 commit 410a8ce
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/lib-http-proxy-common-test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var common = require('../lib/http-proxy/common'),
url = require('url'),
expect = require('expect.js');

describe('lib/http-proxy/common.js', function () {
Expand Down Expand Up @@ -211,6 +212,20 @@ describe('lib/http-proxy/common.js', function () {

expect(outgoing.path).to.eql('/forward/?foo=bar//&target=http:https://foobar.com/?a=1%26b=2&other=2');
})

//
// This is the proper failing test case for the common.join problem
//
it('should correctly format the a toProxy URL', function () {
var outgoing = {};
var google = 'https://google.com'
common.setupOutgoing(outgoing, {
target: url.parse('http:https://sometarget.com:80'),
toProxy: true,
}, { url: google });

expect(outgoing.path).to.eql('/' + google);
})
});

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

0 comments on commit 410a8ce

Please sign in to comment.