superagent-as-promised
Advanced tools
Comparing version 3.0.0 to 3.1.0
@@ -29,1 +29,3 @@ SuperAgent as Promised | ||
.catch arguments... | ||
Request |
@@ -35,8 +35,9 @@ // Generated by CoffeeScript 1.9.1 | ||
}; | ||
return Request.Request.prototype["catch"] = function() { | ||
Request.Request.prototype["catch"] = function() { | ||
var ref; | ||
return (ref = this.endAsync())["catch"].apply(ref, arguments); | ||
}; | ||
return Request; | ||
}; | ||
}).call(this); |
{ | ||
"name": "superagent-as-promised", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "SuperAgent with a Promise twist", | ||
@@ -8,2 +8,3 @@ "main": "index.js", | ||
"prepublish": "coffee -c index.coffee.md", | ||
"pretest": "npm install", | ||
"test": "mocha" | ||
@@ -10,0 +11,0 @@ }, |
@@ -58,5 +58,20 @@ chai = require 'chai' | ||
.then (res) -> | ||
res | ||
.should.eventually.have.property 'ok', true | ||
it 'should handle then() with body', -> | ||
Request | ||
.get 'http://127.0.0.1:3000/foo.json' | ||
.accept 'json' | ||
.then (res) -> | ||
res.body | ||
.should.eventually.deep.equal ok:true | ||
it 'should reject on error', -> | ||
Request | ||
.get 'http://127.0.0.1:3000/unknown' | ||
.then -> | ||
null | ||
.should.be.rejected | ||
it 'should handle catch()', -> | ||
@@ -63,0 +78,0 @@ Request |
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
5461
39