• fn {Function} Default A no-op function.
    • exact {number} Default 1.
    • Returns: {Function} that wraps fn.

    The wrapper function is expected to be called exactly exact times. If the function has not been called exactly exact times when [tracker.verify()][] is called, then [tracker.verify()][] will throw an error.

    1. const assert = require('assert');
    2. // Creates call tracker.
    3. const tracker = new assert.CallTracker();
    4. function func() {}
    5. // Returns a function that wraps func() that must be called exact times
    6. // before tracker.verify().
    7. const callsfunc = tracker.calls(func);