diff --git a/lib/hock.js b/lib/hock.js index da7cc02..266dcfa 100644 --- a/lib/hock.js +++ b/lib/hock.js @@ -83,7 +83,7 @@ Hock.prototype.done = function (cb) { if (this._assertions.length) { this._assertions = this._assertions.filter(function(request) { - return request.isDone(); + return !request.isDone(); }); if (this._assertions.length) { diff --git a/lib/request.js b/lib/request.js index e1aca2a..ac86855 100644 --- a/lib/request.js +++ b/lib/request.js @@ -255,7 +255,7 @@ Request.prototype.sendResponse = function(response) { * @returns {boolean} */ Request.prototype.isDone = function() { - return !(this._count >= this._minRequests && this._count <= this._maxRequests); + return this._minRequests <= this._count && this._count <= this._maxRequests; }; /**