ctx.callCount()
- 返回:<integer> 此模拟被调用的次数。
此函数返回此模拟被调用的次数。此函数比检查 ctx.calls.length 更高效,因为 ctx.calls 是一个 getter,它会创建内部调用跟踪数组的副本。
【This function returns the number of times that this mock has been invoked. This
function is more efficient than checking ctx.calls.length because ctx.calls
is a getter that creates a copy of the internal call tracking array.】