From 063874b60c3c20864db4ebe206212506c57c4f80 Mon Sep 17 00:00:00 2001 From: belviskhoremk Date: Wed, 12 Aug 2026 20:11:15 +0200 Subject: [PATCH] docs: proactively fix the vi.fn spread-args TS2556 pattern in remaining tasks Task 3's implementer independently hit and fixed this exact bug (a vi.fn() given a zero-arg implementation, then invoked via a spread of unknown[] args inside a vi.mock factory, fails tsc -b with TS2556). Applied the same fix (explicit vi.fn<...> generic type) to the other occurrences of this pattern still written the old way in this plan's Task 3 and Task 4 sections, so those implementers don't have to rediscover it from scratch. Task 5, 10, and 11's occurrences were checked and found to already use safe patterns (single literal-arg calls, or bare vi.fn() with no implementation) that don't trigger this. Claude-Session: https://claude.ai/code/session_01NhxA4npAXAxmCDEJt6kxSH --- .../plans/2026-08-12-phase2c-public-site-live-data.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/superpowers/plans/2026-08-12-phase2c-public-site-live-data.md b/docs/superpowers/plans/2026-08-12-phase2c-public-site-live-data.md index be859b9..ca5043a 100644 --- a/docs/superpowers/plans/2026-08-12-phase2c-public-site-live-data.md +++ b/docs/superpowers/plans/2026-08-12-phase2c-public-site-live-data.md @@ -367,7 +367,7 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' const orderMock = vi.fn() const selectMock = vi.fn(() => ({ order: orderMock })) -const fromMock = vi.fn(() => ({ select: selectMock })) +const fromMock = vi.fn<(...args: unknown[]) => { select: typeof selectMock }>(() => ({ select: selectMock })) const resolveImageUrlMock = vi.fn((path: string) => `https://cdn.example/${path}`) vi.mock('../lib/supabase', () => ({ @@ -537,7 +537,7 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' const orderMock = vi.fn() const selectMock = vi.fn(() => ({ order: orderMock })) -const fromMock = vi.fn(() => ({ select: selectMock })) +const fromMock = vi.fn<(...args: unknown[]) => { select: typeof selectMock }>(() => ({ select: selectMock })) const resolveImageUrlMock = vi.fn((path: string) => `https://cdn.example/${path}`) vi.mock('../lib/supabase', () => ({