ctx.accesses


一个 getter,用于返回用于追踪对模拟属性的访问(获取/设置)的内部数组的副本。数组中的每个条目都是一个包含以下属性的对象:

【A getter that returns a copy of the internal array used to track accesses (get/set) to the mocked property. Each entry in the array is an object with the following properties:】

  • type <string> 取值为 'get''set',表示访问类型。
  • value <any> 读取(用于 'get')或写入(用于 'set')的值。
  • stack <Error> 一个 Error 对象,其堆栈可用于确定模拟函数调用的位置。