Class gabarito.Spy
Class defined in:lib/gabarito.js:1296
The spy relays the calls to the actual function, but records every call, along with its parameters, its return or error if thrown.
To verify a given call, the gabarito.SpyVerifier may be obtained through the verify method.
Index
Methods
handler.noCalls( [msg] )
lib/gabarito.js:1355
Relays the noCalls call to the spy instance.
Parameters:-
[msg]<String>
gabarito.SpyVerifier
handler.verify( [msg] )
lib/gabarito.js:1339
Relays the verify call to the spy instance.
Parameters:-
[msg]<String>
Returns: <gabarito.SpyVerifier>
static Function on( fn )
lib/gabarito.js:1385
Creates a spy instance and returns its handler
Parameters:-
fn<Function>The function to spy on
Returns: <Function>
Returns the handler function from the spy instance
gabarito.SpyVerifier
verify( [msg] )
lib/gabarito.js:1402
Returns a spy verifier if a call was made
Parameters:-
[msg]<String>
Returns: <gabarito.SpyVerifier>
Properties
handler <Function>lib/gabarito.js:1313
The handler function that relays all the calls, this is the actual function that should be used instead of the real one.