interface Spy.Fn<F>
The spied function type containing extra information about the function calls.
Extends: FuncInterface<F>, Spy.FnMeta<F>
Type parameters
| Name | Constraints | Description |
|---|---|---|
| F | Func | the spied function type |
Properties
calls
Returns an array containing, for each received spy call, the given parameters.
callsisCalled
Returns true if the spy function has received at least one call.
isCallednrCalls
Returns the number of calls this spy function has received.
nrCallsMethods
clearCalls
Clears the spy functions' calls and nrCalls history.
clearCallscalls and nrCalls history.resetStub
Resets the implementation used for the next spy function call to the original one used at construction time.
resetStubsetStub
Sets a stub implementation for this spy function, which will be used instead of the current function implementation upon the next received call.
setStubDefinition
setStub(stub: Spy.FnStub<F> | undefined): void;
Parameters
| Name | Type | Description |
|---|---|---|
stub | Spy.FnStub<F> | undefined | the stub implementation to use |