author avatar

revath

Mon Mar 04 2019

In jest.fn we can use mockFn.mockRejectedValue and mockFn.mockResolvedValue instead of mockFn.mockReturnValue(Promise.resolve({data: { message: "Failure", count: 1 }}); https://jestjs.io/docs/en/mock-function-api.html#mockfnmockresolvedvaluevalue