Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix toHaveBeenCalledBefore/toHaveBeenCalledAfter type definition #292

Merged
merged 1 commit into from Jul 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions types/index.d.ts
Expand Up @@ -154,7 +154,7 @@ declare namespace jest {
* @param {Mock} mock
* @param {boolean} [failIfNoSecondInvocation=true]
*/
toHaveBeenCalledBefore(mock: jest.Mock, 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 @@ -164,7 +164,7 @@ declare namespace jest {
* @param {Mock} mock
* @param {boolean} [failIfNoFirstInvocation=true]
*/
toHaveBeenCalledAfter(mock: jest.Mock, 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 Expand Up @@ -579,7 +579,7 @@ declare namespace jest {
* @param {Mock} mock
* @param {boolean} [failIfNoSecondInvocation=true]
*/
toHaveBeenCalledBefore(mock: jest.Mock, failIfNoSecondInvocation: boolean): any;
toHaveBeenCalledBefore(mock: jest.MockInstance<any, any[]>, failIfNoSecondInvocation: boolean): any;

/**
* Use `.toHaveBeenCalledAfter` when checking if a `Mock` was called after another `Mock`.
Expand All @@ -589,7 +589,7 @@ declare namespace jest {
* @param {Mock} mock
* @param {boolean} [failIfNoFirstInvocation=true]
*/
toHaveBeenCalledAfter(mock: jest.Mock, failIfNoFirstInvocation: boolean): any;
toHaveBeenCalledAfter(mock: jest.MockInstance<any, any[]>, failIfNoFirstInvocation: boolean): any;

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