[test] for override method feature

This commit is contained in:
Jarrett Cruger 2018-04-19 16:57:35 -04:00 committed by Charlie Robbins
parent d533a1be43
commit 81d58c531b

View File

@ -347,6 +347,16 @@ describe('lib/http-proxy/common.js', function () {
expect(outgoing.secureProtocol).eql('my-secure-protocol'); expect(outgoing.secureProtocol).eql('my-secure-protocol');
}); });
it('should handle overriding the `method` of the http request', function () {
var outgoing = {};
common.setupOutgoing(outgoing, {
target: url.parse('https://whooooo.com'),
method: 'POST' ,
}, { method: 'GET', url: '' });
expect(outgoing.method).eql('POST');
});
// url.parse('').path => null // url.parse('').path => null
it('should not pass null as last arg to #urlJoin', function(){ it('should not pass null as last arg to #urlJoin', function(){
var outgoing = {}; var outgoing = {};