Last active
February 19, 2020 06:55
-
-
Save nurmuhammadsirat/3b92a5b4c81554ce07ace918f4f98f91 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // Put this whole file in __mocks__ folder as a sibling to __tests__ | |
| // In the xxxx.test.js, you can do an import 'mockAxios' from 'axios' | |
| const mockAxios = jest.genMockFromModule("axios"); | |
| // @ts-ignore | |
| 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