chai-oauth2orize-grant
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -169,3 +169,35 @@ /** | ||
Test.prototype.error = function(err) { | ||
var self = this | ||
, txn = { protocol: 'oauth2' } | ||
, before = this._txn; | ||
function ready() { | ||
var res = new Response(function() { | ||
if (!self._end) { throw new Error('res#end should not be called'); } | ||
self._end.call(this, res); | ||
}); | ||
if (self._res) { self._res(res); } | ||
function next(err) { | ||
if (!self._next) { throw new Error('next should not be called'); } | ||
self._next.call(this, err); | ||
} | ||
var fn = self._mod.error; | ||
fn(err, txn, res, next); | ||
} | ||
if (before && before.length == 2) { | ||
before(txn, ready); | ||
} else if (before) { | ||
before(txn); | ||
ready(); | ||
} else { | ||
ready(); | ||
} | ||
}; | ||
/** | ||
@@ -172,0 +204,0 @@ * Expose `Test`. |
{ | ||
"name": "chai-oauth2orize-grant", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Helpers for testing OAuth2orize grants with the Chai assertion library.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
8895
239