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

toHaveBeenCalledOnceWith typing is wrong #506

Closed
akoreh opened this issue Sep 8, 2022 · 2 comments · Fixed by #507
Closed

toHaveBeenCalledOnceWith typing is wrong #506

akoreh opened this issue Sep 8, 2022 · 2 comments · Fixed by #507

Comments

@akoreh
Copy link
Contributor

akoreh commented Sep 8, 2022

Bug

  • package version: 3.1.0
  • node version: 18.8.0
  • npm version: 8.18.0

Relevant code or config

node_modules/jest-extended/types/index.d.ts

    toHaveBeenCalledOnceWith(): R;

What you did:

Reproduction repository (if possible):

https://github.com/jest-community/jest-extended/blob/main/types/index.d.ts#L177

Feature Request

Description:
The toHaveBeenCalledOnceWith method typing has no parameters, failing in typescript with expected 0 parameters but got x

Possible solution: The typing should have parameters

@akoreh
Copy link
Contributor Author

akoreh commented Sep 10, 2022

#507

@SimenB SimenB linked a pull request Sep 10, 2022 that will close this issue
4 tasks
@akoreh
Copy link
Contributor Author

akoreh commented Dec 13, 2022

This occurs again. A subsequent PR introduced a regression by removing the spread operator. The method can now only be called with a single parameter, while the original from jest can be called with any number of parameters, since you can spy on methods being called with any number of parameters.

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.

1 participant