no-unsafe-test-double-cast
Disallow mock-backed test doubles that bypass collaborator contracts through double assertions.
Why
Casting a partial object through unknown hides missing or stale collaborator members, so production interface changes can compile while the test double silently drifts.
Fix
Define the smallest injected port and implement a typed recording fake, or make the fixture satisfy the real contract without passing through unknown.
Examples
import { vi } from "vitest";const client = { read: vi.fn() } as unknown as Client;const client = { read: async () => ({ id: "1" }) } satisfies Pick<Client, "read">;