Use Request Handlers To Mock Data Fetching Tests
Topic | Source |
---|---|
๐งฉ React | React Testing Library and Jest: The Complete Guide - Udemy |
Request handlers only intercept the actual request you are doing (e.g. axios or fetch) and return some mock data instead of sending the request. This allows you to test all code except the actual request, which makes it superior to module mocking.