Options
All
  • Public
  • Public/Protected
  • All
Menu

Type parameters

Hierarchy

  • SpyAnd

Index

Properties

identity

identity: string

Methods

callFake

  • callFake(fn: Fn): Spy<Fn>
  • By chaining the spy with and.callFake, all calls to the spy will delegate to the supplied function.

    Parameters

    • fn: Fn

    Returns Spy<Fn>

callThrough

  • callThrough(): Spy<Fn>
  • By chaining the spy with and.callThrough, the spy will still track all calls to it but in addition it will delegate to the actual implementation.

    Returns Spy<Fn>

rejectWith

  • Tell the spy to return a promise rejecting with the specified value when invoked.

    Parameters

    Returns Spy<Fn>

resolveTo

  • Tell the spy to return a promise resolving to the specified value when invoked.

    Parameters

    Returns Spy<Fn>

returnValue

  • By chaining the spy with and.returnValue, all calls to the function will return a specific value.

    Parameters

    Returns Spy<Fn>

returnValues

  • By chaining the spy with and.returnValues, all calls to the function will return specific values in order until it reaches the end of the return values list.

    Parameters

    Returns Spy<Fn>

stub

  • When a calling strategy is used for a spy, the original stubbing behavior can be returned at any time with and.stub.

    Returns Spy

throwError

  • By chaining the spy with and.throwError, all calls to the spy will throw the specified value.

    Parameters

    Returns Spy

Generated using TypeDoc