Why?
- Mocking is faster. You don't have to wait for the API response and you don't have to deal with rate limits.
- It makes your tests pure, meaning whether they fail or pass depends only on your code, not the data the API returns.
git clone
this repocd
into directoryyarn install
yarn start
- this will load a view with my GitHub profile information (an API response!)
yarn test