I am writing this post to show how to mock and test fetch with jest-fetch-mock. let’s suppose that you are using Jest and you are comfortable with “async/await”.
In this post, we are going to test an application that is going to request information from:
https://us-central1-js-capstone-backend.cloudfunctions.net/api/games/
To make it possible, we have to mock our fetch.
#jest #api #testing #developer