Interface ExpectedSpyCall<Self, Args, Return>

Call information recorded by a spy.

interface ExpectedSpyCall<Self, Args, Return> {
    args?: [...Args[], ...unknown[]];
    error?: {
        Class?: (new (...args: any[]) => Error);
        msgIncludes?: string;
    };
    returned?: Return;
    self?: Self;
}

Type Parameters

  • Self = any
  • Args extends unknown[] = any[]
  • Return = any

Properties

args?: [...Args[], ...unknown[]]

Arguments passed to a function when called.

error?: {
    Class?: (new (...args: any[]) => Error);
    msgIncludes?: string;
}

The expected thrown error.

Type declaration

  • OptionalClass?: (new (...args: any[]) => Error)

    The class for the error that was thrown by a function.

      • new (...args): Error
      • Parameters

        • Rest...args: any[]

        Returns Error

  • OptionalmsgIncludes?: string

    Part of the message for the error that was thrown by a function.

returned?: Return

The value that was returned by a function. If you expect a promise to reject, expect error instead.

self?: Self

The instance that a method was called on.