Skip to content

Commit

Permalink
Document assumption in pendingMocks()
Browse files Browse the repository at this point in the history
  • Loading branch information
pimterry committed Oct 17, 2016
1 parent 143e42e commit 475c7a5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/scope.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ Scope.prototype.pendingMocks = function pendingMocks() {
var pendingInterceptorKeys = Object.keys(this.keyedInterceptors).filter(function (key) {
var interceptorList = self.keyedInterceptors[key];
var pendingInterceptors = interceptorList.filter(function (interceptor) {
// TODO: This assumes that completed mocks are removed from the keyedInterceptors list
// (when persistence is off). We should change that (and this) in future.
var persistedAndUsed = self._persist && interceptor.interceptionCounter > 0;
return !persistedAndUsed && !interceptor.optional;
});
Expand Down

0 comments on commit 475c7a5

Please sign in to comment.