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
So for your mock, axios return a promise with value which is a happy path. However, what if i want to mock it to return an error.
Wonder if i can do like this
const func = jest.fn(); jest.mock('axios', () => { get: func });
then in each test case, can i do func.mockReturnValue for happy and error case?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
So for your mock, axios return a promise with value which is a happy path. However, what if i want to mock it to return an error.
Wonder if i can do like this
then in each test case, can i do func.mockReturnValue for happy and error case?
The text was updated successfully, but these errors were encountered: