Closed ayartsev7 closed 3 years ago
Can you not use
m.f.calledWith(value).mockReturnValueOnce('result 1').mockReturnValueOnce('result 2');
?
I've just provided the minimal test. In my real test suite I typically setup calledWith(value).mockReturnValue in beforeEach with some custom value for all tests and I want to override this returned value for a single test.
With jest I can do this, the following test passes
const f = jest.fn();
f.mockReturnValue('result 1');
f.mockReturnValue('result 2');
test('', () => {
expect(f()).toBe('result 2');
});
so I expected jest-mock-extended to behave in the same way.
Hi!
I use jest-mock-extended v1.0.10 + jest v24.9.0 Failing to change return value of calledWith for the same argument. Here is a minimal example:
Test fails, m.f(value) returns 'result 1'. Is this a bug?