Instead of manually mocking, we can instead use `jest.fn()` and assert that the correct calls were made.