Skip to main content

interface MockFunctionCall

Type Parameters #

#F extends Function
#ReturnType = F extends (...args: any) => infer T ? T : F extends new (...args: any) => infer T ? T : unknown
#Args = F extends (...args: infer Y) => any ? Y : F extends new (...args: infer Y) => any ? Y : unknown[]

Properties #

An array of the arguments passed to the mock function.

#error: unknown | undefined

If the mocked function threw then this property contains the thrown value.

#result: ReturnType | undefined

The value returned by the mocked function.

If the mocked function threw, it will be undefined.

#stack: Error

An Error object whose stack can be used to determine the callsite of the mocked function invocation.

#target: F extends new (...args: any) => any ? F : undefined

If the mocked function is a constructor, this field contains the class being constructed. Otherwise this will be undefined.

#this: unknown

The mocked function's this value.

Did you find what you needed?

Privacy policy