`toHaveBeenCalledBefore` and `toHaveBeenCalledAfter` typings require a second argument that's actually optional
See original GitHub issueThis was introduced in v3.
See:
I get error TS2554: Expected 2 arguments, but got 1.
in my existing code now.
Would you accept a PR to make the second argument optional in index.d.ts
? I was going to create the PR preemptively but I noticed the JSDoc defined the second arg with a default value, so I wasn’t sure if it was actually a build issue.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
[@types/jasmine] Jasmine toHaveBeenCalledWith ... - GitHub
[@types/jasmine] Jasmine toHaveBeenCalledWith matcher treats optional method arguments as required under some conditions #43989.
Read more >How to use "toHaveBeenCalledAfter" with a function that has ...
I have a function: funtion foo() { Spinner.setVisible(true); await ApiService.doApiCall(); Spinner.setVisible(false); }.
Read more >Jest-extended: Additional Jest Matchers - Morioh
Use .toHaveBeenCalledAfter when checking if a Mock was called after another Mock . it('calls mock1 after mock2', () => { const mock1 =...
Read more >Jest assert over single or specific argument/parameters with ...
With Jest it's possible to assert of single or specific arguments/parameters of a mock function call with .toHaveBeenCalled /
Read more >Expect - Jest
When you're writing tests, you often need to check that values meet certain ... The argument to expect should be the value that...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
released https://github.com/jest-community/jest-extended/releases/tag/v3.0.1 👍
And I just looked at the PRs and not the issues 😆