Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "portals", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"authors": [ | ||
@@ -27,4 +27,6 @@ "Nick Glenn <nick@helpfulhuman.com>" | ||
"test", | ||
"tests" | ||
"tests", | ||
"gulpfile.js", | ||
"LICENSE" | ||
] | ||
} |
{ | ||
"name": "portals", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "An XHR/Ajax library with sugar for single page applications.", | ||
@@ -5,0 +5,0 @@ "main": "portals.js", |
@@ -181,3 +181,3 @@ "use strict"; | ||
status: this.status, | ||
headers: this.responseHeaders, | ||
headers: this.responseHeaders || {}, | ||
body: this.responseText | ||
@@ -184,0 +184,0 @@ }; |
@@ -32,3 +32,3 @@ describe('Portal#send()', function () { | ||
// set up the fake response | ||
this.requests[0].respond(200, {}, data); | ||
this.requests[0].respond(200, { Accept: 'application/json' }, data); | ||
@@ -39,2 +39,4 @@ // proceed with promise resolution | ||
expect(res.body).to.equal(data); | ||
expect(res.headers).to.be.an('object'); | ||
expect(res.headers.Accept).to.equal('application/json'); | ||
done(); | ||
@@ -47,3 +49,3 @@ }); | ||
*/ | ||
it('sends a simple GET request with success', function (done) { | ||
it('sends a simple GET request with failure', function (done) { | ||
var opts = { method: 'GET', url: '/' }; | ||
@@ -54,3 +56,3 @@ var data = JSON.stringify({ foo: 'bar' }); | ||
// set up the fake response | ||
this.requests[0].respond(402, {}, data); | ||
this.requests[0].respond(402, { Accept: 'application/json' }, data); | ||
@@ -61,2 +63,4 @@ // proceed with promise resolution | ||
expect(err.body).to.equal(data); | ||
expect(err.headers).to.be.an('object'); | ||
expect(err.headers.Accept).to.equal('application/json'); | ||
done(); | ||
@@ -63,0 +67,0 @@ }); |
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
30576
680