Comparing version 1.6.0 to 1.7.0
@@ -219,2 +219,6 @@ var Bequest = (function () { | ||
xhr.onerror = function (e) { | ||
return callback(e, null); | ||
}; | ||
Object.keys(headers).forEach(function (header) { | ||
@@ -221,0 +225,0 @@ xhr.setRequestHeader(header, headers[header]); |
@@ -128,2 +128,4 @@ /* eslint-env browser */ | ||
xhr.onerror = e => callback(e, null); | ||
Object.keys(headers).forEach(header => { | ||
@@ -130,0 +132,0 @@ xhr.setRequestHeader(header, headers[header]); |
{ | ||
"name": "bequest", | ||
"version": "1.6.0", | ||
"version": "1.7.0", | ||
"description": "An ajax class", | ||
@@ -12,3 +12,3 @@ "main": "dist/ajax.js", | ||
"test": "cat test/bequest.test.dist.js | tape-run --static . --browser phantomjs --render tap-spec", | ||
"prepublish": "scriptkit" | ||
"prepublishOnly": "scriptkit" | ||
}, | ||
@@ -15,0 +15,0 @@ "watch": { |
@@ -110,2 +110,12 @@ import Ajax from '../index'; | ||
test('Error', assert => { | ||
Ajax.get('/dummy', { a: 'b', foo: 3 }, (e, data) => { | ||
assert.equal(e, 'error', 'Error passed'); | ||
assert.equal(data, null, 'Data is null'); | ||
assert.end(); | ||
}); | ||
xhr.onerror('error'); | ||
}); | ||
test('GET', assert => { | ||
@@ -112,0 +122,0 @@ Ajax.get('/dummy', { a: 'b', foo: 3 }); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
714791
8
16
7003
1