Cannot pass mock as parameter for toBeCalledWith
See original GitHub issueWhen I call toBeCalledWith passing another mock as parameter an error occurs.
Sample code:
expect(myMock.sampleMethod).toBeCalledWith(otherMock);
Error:
TypeError: Result of the Symbol.iterator method is not an object
Issue Analytics
- State:
- Created 3 years ago
- Reactions:9
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Jest passing an object to expect().toBeCalledWith()
The problem is I want to test a function that takes object as a parameter so when you call expect(myFunc).toBeCalledWith(object); the test ...
Read more >Mock Functions or Spies Demystified - How Does jest.fn() Work?
You can pass them as arguments to other functions, they can be assigned as properties of objects (as methods), or you can return...
Read more >Cannot validate mock of method with out parameter received ...
in the above code I'm trying to validate that the mock received a call to a method that has an out parameter defined....
Read more >Mock Functions - Jest
Mock functions allow you to test the links between code by erasing the actual implementation of a function, capturing calls to the function ......
Read more >API Reference | Vitest
This assertion checks if a function was called with certain parameters at it's last invocation. Requires a spy function to be passed to...
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
Yep, released as of now so give it a go.
On Fri, 12 Jun 2020, 09:23 asnaseer-resilient, notifications@github.com wrote:
I assume this will be published as v1.0.9 - is there any eta on this?