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

[Bug]: The second param of toHaveBeenCalledBefore/toHaveBeenCalledAfter has default value, but is not typed as optional #651

Closed
Yupeng-li opened this issue Sep 12, 2023 · 1 comment · Fixed by #650

Comments

@Yupeng-li
Copy link

Bug

  • package version: 4.0.1
  • node version: 18.17.0
  • npm (or yarn) version: yarn 1.22.19

Relevant code or config

expect(myFunction).toHaveBeenCalledAfter(anotherFunction)

What you did:
I used toHaveBeenCalledAfter and didn't provide failIfNoSecondInvocation as above.
What happened (please provide anything you think will help):

The doc says it's default to true, but I got typescript error complaining the missing param. The code here shows that the second param failIfNoSecondInvocation is required. https://github.com/jest-community/jest-extended/blob/main/types/index.d.ts#L149

@Blond11516
Copy link
Contributor

I already have a PR open to fix this #650

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants