Node v14.2.0(현재 버전)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
const assert = require('assert');

const tracker = new assert.CallTracker();

function func() {}
const callsfunc = tracker.calls(func);

console.log(tracker.report());
/*
[
{
message: 'Expected the func function to be executed 1 time(s) but was executed 0 time(s).',
actual: 0,
expected: 1,
operator: 'func',
stack: Error
...
}
]
*/

ConorDavenport가 기여하였습니다.#31982.