Search⌘ K

Solution to the Exercise

Understand how to mock modules in Jest by examining the createTask function example. Learn to set up fetch mocks, verify POST requests, and ensure your unit tests handle API calls correctly, building your skills in testing React applications effectively.

We'll cover the following...

Exercise recap

In the last lesson, we tested and implemented the getTasks and updateTask functions. This was possible thanks to the jest-fetch-mock library, which mocked out the fetch function for us. Your task was to do the same for the createTask ...