Interface: SpyStrategy

SpyStrategy

Members

identity :String

Get the identifying information for the spy.
Type:
  • String
Source:

Methods

callFake(fn)

Tell the spy to call a fake implementation when invoked.
Parameters:
Name Type Description
fn function The function to invoke with the passed parameters.
Source:

callThrough()

Tell the spy to call through to the real implementation when invoked.
Source:

exec()

Execute the current spy strategy.
Source:

returnValue(value)

Tell the spy to return the value when invoked.
Parameters:
Name Type Description
value * The value to return.
Source:

returnValues(…values)

Tell the spy to return one of the specified values (sequentially) each time the spy is invoked.
Parameters:
Name Type Attributes Description
values * <repeatable>
Values to be returned on subsequent calls to the spy.
Source:

stub()

Tell the spy to do nothing when invoked. This is the default.
Source:

throwError(something)

Tell the spy to throw an error when invoked.
Parameters:
Name Type Description
something Error | String Thing to throw
Source: