marchaos / jest-mock-extended

Type safe mocking extensions for Jest https://www.npmjs.com/package/jest-mock-extended
MIT License
845 stars 59 forks source link

Cannot pass mock as parameter for toBeCalledWith #28

Closed bizu82 closed 4 years ago

bizu82 commented 4 years ago

When 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

DavidMhn commented 4 years ago

I have the same issue, is there any workaround?

asnaseer-resilient commented 4 years ago

I also experienced this issue and used the following undesirable workaround (based on the code above):

expect(myMock.sampleMethod.mock.calls[0][0]).toBe(otherMock);
marchaos commented 4 years ago

Should be fixed. Let me know if it is not otherwise

asnaseer-resilient commented 4 years ago

I assume this will be published as v1.0.9 - is there any eta on this?

marchaos commented 4 years ago

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?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/marchaos/jest-mock-extended/issues/28#issuecomment-643143336, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAVBY6IMW65SGAUEEEWWYX3RWHQZTANCNFSM4MGFI5LA .