Documentation Home
This page is for an older version of Jasmine (2.9).
The current stable version of Jasmine is: 5.5. You can also look at the docs for the next release: Edge

Namespace: and

Spy#and

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.

callThrough()

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

exec()

Execute the current spy strategy.

identity() → {String}

Return the identifying information for the spy.

Returns:
Type
String

returnValue(value)

Tell the spy to return the value when invoked.

Parameters:
Name Type Description
value *

The value to return.

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.

stub()

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

throwError(something)

Tell the spy to throw an error when invoked.

Parameters:
Name Type Description
something Error | String

Thing to throw