vi.fn
mock/spy的側面も、stub的側面も備えている
code:ts
const getApples = vi.fn(() => 0)
getApples()
expect(getApples).toHaveBeenCalled() // spy
expect(getApples).toHaveReturnedWith(0) // spy
getApples.mockReturnValueOnce(5) // stub
const res = getApples()
expect(res).toBe(5)
expect(getApples).toHaveNthReturnedWith(2, 5)