ctx.callCount()


新增于: v19.1.0, v18.13.0
  • 返回:<integer> 这个模拟被调用的次数。

    \Returns: <integer> The number of times that this mock has been invoked.

此函数返回此模拟已被调用的次数。此函数比检查 ctx.calls.length 更有效,因为 ctx.calls 是创建内部调用跟踪数组副本的获取器。

\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.

AltStyle によって変換されたページ (->オリジナル) /