marchaos / jest-mock-extended

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

How can I modify the value define in mockReturnValue on a second call to the mocked method/function #73

Open aruizca opened 3 years ago

aruizca commented 3 years ago

Hi there,

when I do something like:

myMock.function
      .calledWith(anyObject())
      .mockReturnValue(generateValue());

If I called myMock.function twice, the generateValue() function is only called once. I need for that value to change over time. Is there any way please?

Thanks for you time and your awesome lib!