Created
July 19, 2018 06:53
-
-
Save kilgarenone/6340f77faead52ad0a3a06ab9f7d6930 to your computer and use it in GitHub Desktop.
axios mock file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// src/__mocks__/axios.ts | |
const mockAxios = jest.genMockFromModule('axios') | |
// this is the key to fix the axios.create() undefined error! | |
mockAxios.create = jest.fn(() => mockAxios) | |
export default mockAxios |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment