Skip to content

Commit

Permalink
[test] for override method feature
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrugzz committed Apr 19, 2018
1 parent 2f6f2e0 commit 52d8fa1
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions test/lib-http-proxy-common-test.js
Expand Up @@ -251,7 +251,7 @@ describe('lib/http-proxy/common.js', function () {

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

it('should not replace :\ to :\\ when no http word before', function () {
var outgoing = {};
var google = 'http://google.com:/join/join.js'
Expand All @@ -262,7 +262,7 @@ describe('lib/http-proxy/common.js', function () {

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

describe('when using ignorePath', function () {
it('should ignore the path of the `req.url` passed in but use the target path', function () {
var outgoing = {};
Expand Down Expand Up @@ -347,6 +347,16 @@ describe('lib/http-proxy/common.js', function () {
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
it('should not pass null as last arg to #urlJoin', function(){
var outgoing = {};
Expand Down

0 comments on commit 52d8fa1

Please sign in to comment.