Skip to content

Glossary: Testing Web Apps

Mock

Also written: mocks, mock function, vi.fn

A test double that also records how it was called. `vi.fn()` makes a mock function, and Vitest calls all test doubles "mocks".

Where the book teaches it

Related terms

StubFakeTest doublevi.mock