Comparing version 2.3.1 to 2.3.2
17
index.js
@@ -91,11 +91,2 @@ "use strict"; | ||
var failureResponse = { | ||
body: undefined, | ||
headers: {}, | ||
statusCode: 0, | ||
method: method, | ||
url: uri, | ||
rawRequest: xhr | ||
} | ||
function errorFunc(evt) { | ||
@@ -161,2 +152,10 @@ clearTimeout(timeoutTimer) | ||
var timeoutTimer | ||
var failureResponse = { | ||
body: undefined, | ||
headers: {}, | ||
statusCode: 0, | ||
method: method, | ||
url: uri, | ||
rawRequest: xhr | ||
} | ||
@@ -163,0 +162,0 @@ if ("json" in options && options.json !== false) { |
{ | ||
"name": "xhr", | ||
"version": "2.3.1", | ||
"version": "2.3.2", | ||
"description": "small xhr abstraction", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -44,2 +44,13 @@ var window = require("global/window") | ||
test("[func] Request to domain with not allowed cross-domain", function(assert) { | ||
xhr({ | ||
uri: "http://www.mocky.io/v2/57bb70c21000002f175850bd", | ||
}, function(err, resp, body) { | ||
assert.ok(err instanceof Error, "should return error") | ||
assert.equal(resp.statusCode, 0) | ||
assert.equal(typeof resp.rawRequest, "object") | ||
assert.end() | ||
}) | ||
}) | ||
test("[func] Returns a falsy body for 204 responses", function(assert) { | ||
@@ -46,0 +57,0 @@ xhr({ |
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
29210
9
527