Skip to content

Stop excluding test files from CMS typecheck

Problem

apps/cms/tsconfig.json excludes test/spec files from typecheck. This diverges from LMS (which types its tests) and means typos in fixtures or assertion helpers are only caught at test runtime.

Proposal

  1. Remove the test-file exclude entries from apps/cms/tsconfig.json.
  2. Run npm run typecheck --workspace apps/cms and fix the fallout. Expected fixes:
    • Missing types on fixture builders.
    • any-typed mocks tightened to the real shape.
  3. Where a test genuinely needs to bypass a type (e.g. constructing a partial DB row for a specific assertion), use satisfies plus a local helper rather than as any.

Acceptance criteria

  • CMS tsconfig.json no longer excludes *.test.* / *.spec.* / __tests__/**.
  • npm run typecheck is green for CMS.
  • No new // @ts-ignore / as any introduced (rg sweep clean vs baseline).
  • npm run check passes.

Out of scope

  • Restructuring test layouts (__tests__/ vs co-located).
  • Enabling noUncheckedIndexedAccess (covered by T-007).

Notes / decisions log

  • 2026-05-24: Ticket created from monorepo audit.
  • 2026-05-25: Delivered in the same change set as T-007 (bundled per execution decision). Test fallout fixed with shared helpers and .at()/guard patterns across stores, hooks, e2e specs, and widget tests.