assert.CallTracker.prototype.getCalls - Node documentation
method assert.CallTracker.prototype.getCalls

Usage in Deno

import assert from "node:assert";
CallTracker.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

fn: Function

Return Type

An Array with all the calls to a tracked function.