Last active
February 22, 2020 23:04
-
-
Save darde/da5cfe48b48a7c5878140862d2d5bdad to your computer and use it in GitHub Desktop.
Medium store - Testing asynchronous code with Jest and Testing Library React - src/services/fetchPosts.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
import axios from 'axios'; | |
const BASE_URL = 'https://jsonplaceholder.typicode.com/posts'; | |
export default async () => { | |
const response = await axios.get(BASE_URL); | |
return response.data; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment