Skip to content

type-architecture: add real tsc type-checking for tests #198

@iamfj

Description

@iamfj

What problem does this solve?

Tests are excluded from tsconfig.json. The config comment says tests are type-checked by Vitest at runtime, but Vitest does not provide the same guarantee as tsc --noEmit.

This lets test helpers and mocks drift from source types without a dedicated compiler check.

Proposed solution

Add a tsconfig.test.json that includes src, tests, and Vitest config, then add a package script for test type-checking.

Example:

{
  "extends": "./tsconfig.json",
  "compilerOptions": {
    "rootDir": ".",
    "noEmit": true,
    "types": ["node", "vitest"]
  },
  "include": ["src/**/*", "tests/**/*", "vitest.config.ts"]
}

Acceptance criteria:

  • Tests are checked by tsc.
  • CI runs the test type-check script.
  • The misleading tsconfig comment is corrected or removed.
  • Existing tests still run normally under Vitest.

Alternatives considered

Keep relying on Vitest transpilation. This is not equivalent to project-wide type-checking.

Primary use case

LLM agent integration

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:P1Highest-priority planned work; should be implemented nextqa:smell

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions