We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have a mock, and I have setup a call.
const mock = jest.fn(); when(mock).calledWith("hello").mockResolvedValue("world");
I then need to implement "Once" style calls, overriding the function.
mock.mockReset(); when(mock).calledWith("hello").mockResolvedValueOnce("world"); when(mock).calledWith("hello").mockResolvedValueOnce("example");
Unfortunately, this clears all existing when mocks. Ideally, I could do this, which would clear any mocks for this specific set of arguments.
when(mock).calledWith("hello").mockReset()
It could then be chained something like this:
when(mock).calledWith("hello").mockResolvedValue("world"); when(mock) .calledWith("hello") .mockReset() .mockResolvedValueOnce("example");
The text was updated successfully, but these errors were encountered:
v3.7.0
Sorry, something went wrong.
No branches or pull requests
I have a mock, and I have setup a call.
I then need to implement "Once" style calls, overriding the function.
Unfortunately, this clears all existing when mocks. Ideally, I could do this, which would clear any mocks for this specific set of arguments.
It could then be chained something like this:
The text was updated successfully, but these errors were encountered: