Created
February 22, 2020 22:46
-
-
Save darde/c1a91fca62ea190ff381a879a544f052 to your computer and use it in GitHub Desktop.
Medium store - Testing asynchronous code with Jest and Testing Library React - src/__mocks__/axios.js
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
export default { | |
get: jest.fn(() => Promise.resolve({ | |
data: [ | |
{ | |
id: 1, | |
title: 'This is a tech post', | |
}, | |
{ | |
id: 2, | |
title: 'Post about testing code', | |
} | |
]})), | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment