Skip to content

Commit 9231e42

Browse files
authored
Mark toHaveBeenCalledBefore and After's second parameter as optional (#650)
* Mark toHaveBeenCalledBefore's second parameter as optional `toHaveBeenCalledBefore`'s first parameter should be optional because it has a default value. * Mark toHaveBeenCalledAfter's second parameter as optional
1 parent 0db8bf6 commit 9231e42

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

types/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ interface CustomMatchers<R> extends Record<string, any> {
146146
* @param {Mock} mock
147147
* @param {boolean} [failIfNoSecondInvocation=true]
148148
*/
149-
toHaveBeenCalledBefore(mock: jest.MockInstance<any, any[]>, failIfNoSecondInvocation: boolean): R;
149+
toHaveBeenCalledBefore(mock: jest.MockInstance<any, any[]>, failIfNoSecondInvocation?: boolean): R;
150150

151151
/**
152152
* Use `.toHaveBeenCalledAfter` when checking if a `Mock` was called after another `Mock`.
@@ -156,7 +156,7 @@ interface CustomMatchers<R> extends Record<string, any> {
156156
* @param {Mock} mock
157157
* @param {boolean} [failIfNoFirstInvocation=true]
158158
*/
159-
toHaveBeenCalledAfter(mock: jest.MockInstance<any, any[]>, failIfNoFirstInvocation: boolean): R;
159+
toHaveBeenCalledAfter(mock: jest.MockInstance<any, any[]>, failIfNoFirstInvocation?: boolean): R;
160160

161161
/**
162162
* Use `.toHaveBeenCalledOnce` to check if a `Mock` was called exactly one time.

0 commit comments

Comments
 (0)