Skip to content

Commit

Permalink
Allow chaining mockClear and mockReset (jestjs#4475)
Browse files Browse the repository at this point in the history
  • Loading branch information
iofjuupasli authored and tabrindle committed Oct 2, 2017
1 parent ef3e0d1 commit 4a7a950
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/jest-mock/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,11 +387,13 @@ class ModuleMockerClass {

f.mockClear = () => {
this._mockState.delete(f);
return f;
};

f.mockReset = () => {
this._mockState.delete(f);
this._mockConfigRegistry.delete(f);
return f;
};

f.mockReturnValueOnce = value => {
Expand Down

0 comments on commit 4a7a950

Please sign in to comment.