perf(test): speed up memory suites

This commit is contained in:
Peter Steinberger
2026-02-14 16:03:14 +00:00
parent a7142c6218
commit f2c56de955
5 changed files with 47 additions and 35 deletions

View File

@@ -85,7 +85,6 @@ describe("memory embedding batches", () => {
manager = result.manager;
const updates: Array<{ completed: number; total: number; label?: string }> = [];
await manager.sync({
force: true,
progress: (update) => {
updates.push(update);
},
@@ -130,7 +129,7 @@ describe("memory embedding batches", () => {
throw new Error("manager missing");
}
manager = result.manager;
await manager.sync({ force: true });
await manager.sync({ reason: "test" });
expect(embedBatch.mock.calls.length).toBe(1);
});
@@ -191,7 +190,7 @@ describe("memory embedding batches", () => {
}
manager = result.manager;
try {
await manager.sync({ force: true });
await manager.sync({ reason: "test" });
} finally {
setTimeoutSpy.mockRestore();
}
@@ -224,7 +223,7 @@ describe("memory embedding batches", () => {
throw new Error("manager missing");
}
manager = result.manager;
await manager.sync({ force: true });
await manager.sync({ reason: "test" });
const inputs = embedBatch.mock.calls.flatMap((call) => call[0] ?? []);
expect(inputs).not.toContain("");