Skip to content

Commit

Permalink
Mark toHaveBeenCalledBefore and After's second parameter as optional (#…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
Blond11516 authored Oct 9, 2023
1 parent 0db8bf6 commit 9231e42
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ interface CustomMatchers<R> extends Record<string, any> {
* @param {Mock} mock
* @param {boolean} [failIfNoSecondInvocation=true]
*/
toHaveBeenCalledBefore(mock: jest.MockInstance<any, any[]>, failIfNoSecondInvocation: boolean): R;
toHaveBeenCalledBefore(mock: jest.MockInstance<any, any[]>, failIfNoSecondInvocation?: boolean): R;

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

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

0 comments on commit 9231e42

Please sign in to comment.