minimal-request-promise
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -55,2 +55,4 @@ /*global module, require, global */ | ||
}).then(function (parsedUrl) { | ||
if (additionalOptions && additionalOptions.method && additionalOptions.method !== method) | ||
throw new Error('Method can\'t be overridden'); | ||
var options = {}; | ||
@@ -57,0 +59,0 @@ mergeObjects(options, parsedUrl); |
{ | ||
"name": "minimal-request-promise", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "A+ Promise interface to Node.js HTTPS request, with no dependencies", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -56,2 +56,7 @@ /*global beforeEach, afterEach, describe, it, expect, require, jasmine */ | ||
}); | ||
it('rejects in case method is overridden', function () { | ||
helper('https://npmjs.org', { method: 'PUT' }).catch(function (err) { | ||
expect(err instanceof Error).toBeTruthy(); | ||
}); | ||
}); | ||
it('decomposes the URL into params', function (done) { | ||
@@ -78,13 +83,2 @@ https.request.pipe(function (args) { | ||
}); | ||
it('allows options to override method', function (done) { | ||
https.request.pipe(function (args) { | ||
expect(args).toEqual(jasmine.objectContaining({ | ||
method: 'ZOOM', | ||
hostname: 'npmjs.org', | ||
path: '/' | ||
})); | ||
done(); | ||
}); | ||
helper('https://npmjs.org', {method: 'ZOOM'}); | ||
}); | ||
it('allows options to override URL components', function (done) { | ||
@@ -91,0 +85,0 @@ https.request.pipe(function (args) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11758
208