Interface SpyAnd

Index

Methods

Methods

public callFake(fn: Function)

By chaining the spy with and.callFake, all calls to the spy will delegate to the supplied function.

Parameters

  • fn: Function

public callThrough()

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.

public returnValue(val: any)

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

Parameters

  • val: any

public stub()

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

public throwError(msg: string)

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

Parameters

  • msg: string