Skip to main content

getCalls

method assert.CallTracker.prototype.getCalls
Jump to headingCallTracker.prototype.getCalls(fn: Function): CallTrackerCall[]

Example:

import assert from 'node:assert';

const tracker = new assert.CallTracker();

function func() {}
const callsfunc = tracker.calls(func);
callsfunc(1, 2, 3);

assert.deepStrictEqual(tracker.getCalls(callsfunc),
                       [{ thisArg: undefined, arguments: [1, 2, 3] }]);

Parameters Jump to heading

Jump to headingfn: Function

Return Type Jump to heading

An array with all the calls to a tracked function.

Back to top