Skip to content

[finding] packages/runtime type-checks none of its 208 test files — tsconfig excludes **/*.test.ts and no test-typecheck wiring exists #14504

Description

@hotlong

What was measured

packages/runtime type-checks none of its own test files, and nothing reports the gap.

  • packages/runtime/package.json -> "typecheck": "tsc --noEmit".
  • packages/runtime/tsconfig.json -> "exclude": ["node_modules", "dist", "**/*.spec.ts", "**/*.test.ts"].
  • There is no tsconfig.test.json, no check:test-typecheck script, and no test-typecheck-debt.json in the package.

So pnpm --filter @objectstack/runtime typecheck exits 0 over source only. Confirmed by measurement rather than by reading the config: tsc --noEmit --listFiles in that package reports 0 hits for a test file that exists in src/domains/.

The population is not small — the package's suite is 208 test files / 3066 tests.

Why this is the shape AGENTS.md warns about

AGENTS.md states the rule directly: never exclude *.test.ts from a package's tsconfig.json, because tsc --noEmit reads that config, so the exclusion hides the tests from the very check the typecheck script advertises — a green gate over source nothing read. It also names the remedy: a sibling tsconfig.test.json named in the typecheck script, which is what packages/objectql and packages/rest both do (each pairing it with scripts/check-test-typecheck.mts --package ... --project tsconfig.test.json and a shrink-only test-typecheck-debt.json).

A @ts-expect-error written in any packages/runtime test today is therefore a phantom check: it evaluates never, and deleting it leaves every gate just as green.

Suggested shape

Onboard packages/runtime by wiring the shared gate the way its two siblings are wired — never by copying their implementation — and seed the per-file, shrink-only ledger with whatever the first measurement reports. Expect a non-trivial initial count; the ratchet only has to shrink from there.

Observed while landing #14309, which added a test file to packages/runtime/src/domains/ and had to type-check it standalone to know it was sound.

Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions