Clarification re spy properties.
This commit is contained in:
parent
6b32586e1f
commit
687b94374c
@ -347,6 +347,8 @@ There are spy-specfic matchers that are very handy.
|
|||||||
|
|
||||||
`wasNotCalledWith(arguments)` returns true if the object is a spy and was not called with the passed arguments
|
`wasNotCalledWith(arguments)` returns true if the object is a spy and was not called with the passed arguments
|
||||||
|
|
||||||
|
Spies can be trained to respond in a variety of ways when invoked:
|
||||||
|
|
||||||
`andCallThrough()`: spies on AND calls the original function spied on
|
`andCallThrough()`: spies on AND calls the original function spied on
|
||||||
|
|
||||||
`andReturn(arguments)`: returns passed arguments when spy is called
|
`andReturn(arguments)`: returns passed arguments when spy is called
|
||||||
@ -355,6 +357,8 @@ There are spy-specfic matchers that are very handy.
|
|||||||
|
|
||||||
`andCallFake(function)`: calls passed function when spy is called
|
`andCallFake(function)`: calls passed function when spy is called
|
||||||
|
|
||||||
|
Spies have some useful properties:
|
||||||
|
|
||||||
`callCount`: returns number of times spy was called
|
`callCount`: returns number of times spy was called
|
||||||
|
|
||||||
`mostRecentCall.args`: returns argument array from last call to spy.
|
`mostRecentCall.args`: returns argument array from last call to spy.
|
||||||
|
Loading…
Reference in New Issue
Block a user