chore: Fix types in tests 31/N.

This commit is contained in:
cpojer
2026-02-17 14:33:26 +09:00
parent f2f17bafbc
commit 116f5afea3
12 changed files with 185 additions and 85 deletions

View File

@@ -130,7 +130,12 @@ describe("subagent registry persistence", () => {
cleanup: string;
label?: string;
};
const first = announceSpy.mock.calls[0]?.[0] as unknown as AnnounceParams;
const first = (announceSpy.mock.calls as unknown as Array<[unknown]>)[0]?.[0] as
| AnnounceParams
| undefined;
if (!first) {
throw new Error("expected announce call");
}
expect(first.childSessionKey).toBe("agent:main:subagent:test");
expect(first.requesterOrigin?.channel).toBe("whatsapp");
expect(first.requesterOrigin?.accountId).toBe("acct-main");
@@ -167,7 +172,7 @@ describe("subagent registry persistence", () => {
await new Promise((r) => setTimeout(r, 0));
// announce should NOT be called since cleanupHandled was true
const calls = announceSpy.mock.calls.map((call) => call[0]);
const calls = (announceSpy.mock.calls as unknown as Array<[unknown]>).map((call) => call[0]);
const match = calls.find(
(params) =>
(params as { childSessionKey?: string }).childSessionKey === "agent:main:subagent:two",