test: simplify pairing read call counts · openclaw/openclaw@5cb2959
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -210,7 +210,13 @@ async function expectAllowFromCacheInvalidationWithReadSpy(params: {
|
210 | 210 | } |
211 | 211 | |
212 | 212 | function countFileReads(spy: { mock: { calls: unknown[][] } }, filePath: string): number { |
213 | | -return spy.mock.calls.filter(([candidate]) => candidate === filePath).length; |
| 213 | +let count = 0; |
| 214 | +for (const [candidate] of spy.mock.calls) { |
| 215 | +if (candidate === filePath) { |
| 216 | +count++; |
| 217 | +} |
| 218 | +} |
| 219 | +return count; |
214 | 220 | } |
215 | 221 | |
216 | 222 | async function seedDefaultAccountAllowFromFixture(stateDir: string) { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。