Bun

interface

test.default.MockFunctionCall

interface MockFunctionCall<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[]>

  • arguments: Args

    An array of the arguments passed to the mock function.

  • error: unknown

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

  • result: undefined | ReturnType

    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<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.