Despite having launched a video showing how to mock both Fetch and Axios recently… here is another solution, the one recommended by Kent C. Dodds (creator of React Testing Library), showing how to use Mock Service Worker to avoid making actual HTTP requests when you are running your tests.
Code
https://github.com/leighhalliday/msw-example
#axios #web-development #developer