![]() |
VOOZH | about |
The tracker.calls() method is used to keep track of the number of times a function is executed. It returns a wrapper function that should be invoked at exact times. When tracker.verify() is executed, if the method has not been called precisely exact times, tracker.verify() will throw an exception.
Syntax:
tracker.calls([fn][, exact])
Parameters:
Return Value: A wrapper function that wraps fn.
Example 1:
Output:
Hello World Hello World
Example 2:
Output:
Reference: https://nodejs.org/api/assert.html#trackercallsfn-exact