MCPcopy
hub / github.com/vitest-dev/vitest / isMockFunction

Function isMockFunction

packages/spy/src/index.ts:17–21  ·  view source on GitHub ↗
(fn: any)

Source from the content-addressed store, hash-verified

15} from './types'
16
17export function isMockFunction(fn: any): fn is Mock {
18 return (
19 typeof fn === 'function' && '_isMockFunction' in fn && fn._isMockFunction === true
20 )
21}
22
23const MOCK_RESTORE = new Set<() => void>()
24// Jest keeps the state in a separate WeakMap which is good for memory,

Callers 6

assertIsMockFunction · 0.90
JestChaiExpectFunction · 0.90
isMockFunctionFunction · 0.90
fnFunction · 0.70
spyOnFunction · 0.70
createMockFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected