Keeping Mocks Externalized

In this lesson, we'll be separating all mocks in their own Javascript file.

We'll cover the following

Mocks Separation

Jest allows us to have all our mocks separated in their own JavaScript file, placing them under a __mocks__ folder, keeping the tests as clean as possible.

So we can take the jest.mock block from the top of the Form.test.js file out to its own file:

Get hands-on with 1200+ tech skills courses.