mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 21:10:59 +00:00
Type the evaluator stubs as variadic mocks
tsc rejects spreading unknown[] into a zero-parameter vi.fn; give the context-evaluator stubs a variadic signature and cast the recorded call tuples where the tests read them back.
This commit is contained in:
1 parent
db6465c17d
commit
4e12aef5fd
4 files changed
+18
-11
No files matched your search
@@ -52,8 +52,9 @@ describe("nudge-status — NEXT_APP_OPEN hook", () => {
|
||||
await (GET as unknown as () => Promise<unknown>)();
|
||||
|
||||
expect(evaluateContext).toHaveBeenCalledTimes(1);
|
||||
const [prismaArg, userId, trigger] = evaluateContext.mock.calls[0]!;
|
||||
expect((prismaArg as { __tag: string }).__tag).toBe("prisma");
|
||||
const [prismaArg, userId, trigger] = evaluateContext.mock
|
||||
.calls[0] as unknown as [{ __tag: string }, string, string];
|
||||
expect(prismaArg.__tag).toBe("prisma");
|
||||
expect(userId).toBe("u1");
|
||||
expect(trigger).toBe("app-open");
|
||||
// Ordering: the surfaced message must be visible to this very read.
|
||||
|
||||
Reference in new issue
Block a user