Skip to content

Commit

Permalink
Expectation#resolves, rejects, calls should return their own objects
Browse files Browse the repository at this point in the history
  • Loading branch information
kumabook committed Jan 21, 2017
1 parent 5ce39a8 commit da63f42
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/expectation.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ Expectation.prototype.throws = function(error) {
Expectation.prototype.resolves = function(value) {
this.resolvedValue = value;
this.resultType = ResultType.RESOLVE;
return this;
};

Expectation.prototype.rejects = function(reason) {
this.rejectedReason = reason;
this.resultType = ResultType.REJECT;
return this;
};

Expectation.prototype.calls = function(func, thisArg) {
Expand All @@ -54,6 +56,7 @@ Expectation.prototype.calls = function(func, thisArg) {
thisArg: thisArg,
args: args
});
return this;
};

Expectation.prototype.isMeet = function(actualArgs) {
Expand Down

0 comments on commit da63f42

Please sign in to comment.