vi.mock
Also written: vi.mocked, mockResolvedValue
A Vitest call that replaces every export of a module, such as api.js, with mock functions. `vi.mocked(fn)` gives you the mock so you can set its answer.
Also written: vi.mocked, mockResolvedValue
A Vitest call that replaces every export of a module, such as api.js, with mock functions. `vi.mocked(fn)` gives you the mock so you can set its answer.