Skip to content

Commit

Permalink
Create rejected promises when the mock is called and not when configured
Browse files Browse the repository at this point in the history
  • Loading branch information
Håkan Canberger committed Feb 17, 2017
1 parent 8bf9923 commit af99748
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
}

newFn.rejectWith = function (value) {
return newFn.returnWith(simple.Promise.reject(value))
return newFn.callFn(function createRejectedPromise () { return simple.Promise.reject(value) })
}

newFn.callFn = function (fn) {
Expand Down

0 comments on commit af99748

Please sign in to comment.