fix(sp25): typecheck fixups

Three small follow-ups after the live-tail triplet wired up:

  * evictOldest is now generic over (K extends string|number, V) so
    the addAck / addTa1Ack call sites don't need a type assertion.
  * Acks.test.tsx no longer spreads importOriginal() — TypeScript
    was choking on the inferred 'unknown' from the mock factory.
    Use the same ApiError / mock shape that Claims.test.tsx uses.
  * tail-stream.test.ts guards the optional gen.return() with
    so strict mode TS2722 stops complaining about possibly-undefined.
This commit is contained in:
Nora
2026-07-02 09:23:44 -06:00
parent 146cb6d17d
commit 1363d36046
3 changed files with 16 additions and 12 deletions
+7 -3
View File
@@ -9,15 +9,19 @@ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { Acks } from "./Acks";
import { api } from "@/lib/api";
vi.mock("@/lib/api", async (importOriginal) => {
const actual = await importOriginal();
vi.mock("@/lib/api", () => {
class ApiError extends Error {
constructor(public status: number, message: string) {
super(message);
}
}
return {
...actual,
api: {
isConfigured: true,
listAcks: vi.fn(),
getAck: vi.fn(),
},
ApiError,
};
});