Skip to content

refactor(frontend): type-check the shared kit's test files in CI so typed-client assertions are enforced #21091

Open

Description

@mrveiss

Problem

The shared UI kit (libs/autobot-ui) has no type-check of its own: its package.json has only test / test:watch, and each app's tsconfig.app.json excludes src/**/__tests__/*, so a kit test file is only reached through the apps when something imports it (nothing does). vitest strips types without checking them.

Consequence: the compile-time contract assertions in libs/autobot-ui/src/utils/__tests__/ApiClientBase.test.ts (expectTypeOf and @ts-expect-error lines that pin the typed call layer) pass at runtime even if call is widened. They were verified only by hand in review of #21057.

Acceptance criteria

  • libs/autobot-ui has a type-check script covering src/** including __tests__ (a kit tsconfig and npm run type-check).
  • A CI job (or an existing required one) runs it and fails on an unused @ts-expect-error.
  • The job's path filter covers the kit sources and the kit tsconfig.
  • A planted control (a deliberately widened call signature) is shown to fail the check.

Raised by a review thread on #21057 (slice 0 of #12363).

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions