chore: Fix types in tests 36/N.

This commit is contained in:
cpojer
2026-02-17 15:46:48 +09:00
parent 2a4ca7671e
commit 7b31e8fc59
14 changed files with 86 additions and 42 deletions

View File

@@ -43,7 +43,10 @@ describe("memory embedding batches", () => {
});
const status = managerLarge.status();
const totalTexts = embedBatch.mock.calls.reduce((sum, call) => sum + (call[0]?.length ?? 0), 0);
const totalTexts = embedBatch.mock.calls.reduce(
(sum: number, call: unknown[]) => sum + ((call[0] as string[] | undefined)?.length ?? 0),
0,
);
expect(totalTexts).toBe(status.chunks);
expect(embedBatch.mock.calls.length).toBeGreaterThan(1);
expect(updates.length).toBeGreaterThan(0);
@@ -112,7 +115,7 @@ describe("memory embedding batches", () => {
await fs.writeFile(path.join(memoryDir, "2026-01-07.md"), "\n\n\n");
await managerSmall.sync({ reason: "test" });
const inputs = embedBatch.mock.calls.flatMap((call) => call[0] ?? []);
const inputs = embedBatch.mock.calls.flatMap((call: unknown[]) => (call[0] as string[]) ?? []);
expect(inputs).not.toContain("");
});
});