[test] add proper failing test case for #738

This commit is contained in:
Jarrett Cruger 2014-12-02 10:25:30 -07:00
parent d98d9516ea
commit 410a8ce94c

View File

@ -1,4 +1,5 @@
var common = require('../lib/http-proxy/common'), var common = require('../lib/http-proxy/common'),
url = require('url'),
expect = require('expect.js'); expect = require('expect.js');
describe('lib/http-proxy/common.js', function () { describe('lib/http-proxy/common.js', function () {
@ -211,6 +212,20 @@ describe('lib/http-proxy/common.js', function () {
expect(outgoing.path).to.eql('/forward/?foo=bar//&target=http://foobar.com/?a=1%26b=2&other=2'); expect(outgoing.path).to.eql('/forward/?foo=bar//&target=http://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://sometarget.com:80'),
toProxy: true,
}, { url: google });
expect(outgoing.path).to.eql('/' + google);
})
}); });
describe('#setupSocket', function () { describe('#setupSocket', function () {