fix(skills): type watcher mock calls in dedupe regression tests · openclaw/openclaw@bb73f0a
openperf
·
2026-05-22
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -168,7 +168,7 @@ describe("ensureSkillsWatcher", () => {
|
168 | 168 | config: { skills: { load: { extraDirs: ["/tmp/shared-b"] } } }, |
169 | 169 | }); |
170 | 170 | |
171 | | -const callPaths = watchMock.mock.calls.map((call) => call[0] as unknown as string); |
| 171 | +const callPaths = (watchMock.mock.calls as unknown as Array<[string]>).map((call) => call[0]); |
172 | 172 | const sharedAIndex = callPaths.findIndex((target) => target.includes("/tmp/shared-a")); |
173 | 173 | // The dropped extra dir is unsubscribed and its watcher closed; the new dir |
174 | 174 | // gets a fresh watcher. |
@@ -194,7 +194,7 @@ describe("ensureSkillsWatcher", () => {
|
194 | 194 | config: { skills: { load: { extraDirs: ["/tmp/shared"] } } }, |
195 | 195 | }); |
196 | 196 | |
197 | | -const callPaths = watchMock.mock.calls.map((call) => call[0] as unknown as string); |
| 197 | +const callPaths = (watchMock.mock.calls as unknown as Array<[string]>).map((call) => call[0]); |
198 | 198 | // The shared directory is watched exactly once even though two workspaces |
199 | 199 | // include it, instead of one watcher per workspace (the EMFILE root cause). |
200 | 200 | const sharedWatchers = callPaths.filter((target) => target.includes("/tmp/shared")); |
@@ -216,7 +216,7 @@ describe("ensureSkillsWatcher", () => {
|
216 | 216 | config: { skills: { load: { extraDirs: ["/tmp/shared"], watchDebounceMs: 10 } } }, |
217 | 217 | }); |
218 | 218 | |
219 | | -const callPaths = watchMock.mock.calls.map((call) => call[0] as unknown as string); |
| 219 | +const callPaths = (watchMock.mock.calls as unknown as Array<[string]>).map((call) => call[0]); |
220 | 220 | const sharedIndex = callPaths.findIndex((target) => target.includes("/tmp/shared")); |
221 | 221 | expect(sharedIndex).toBeGreaterThanOrEqual(0); |
222 | 222 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。