From 0c2e323ee153e05307d6b7c35dbbbd739abaeeaa Mon Sep 17 00:00:00 2001 From: Kid <44045911+kidonng@users.noreply.github.com> Date: Fri, 9 Sep 2022 15:49:30 +0800 Subject: [PATCH] docs: fix `vi.fn` signature (#2014) --- docs/api/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api/index.md b/docs/api/index.md index 94666f493f7c..67dd4112ce0c 100644 --- a/docs/api/index.md +++ b/docs/api/index.md @@ -1794,7 +1794,7 @@ Vitest provides utility functions to help you out through it's **vi** helper. Yo ### vi.fn -- **Type:** `(fn: Function) => CallableMockInstance` +- **Type:** `(fn?: Function) => CallableMockInstance` Creates a spy on a function, though can be initiated without one. Every time a function is invoked, it stores its call arguments, returns and instances. Also, you can manipulate its behavior with [methods](#mockinstance-methods). If no function is given, mock will return `undefined`, when invoked.