Skip to content

finding(plugin-dashboard): a test header still says this package's tests are compiled by nothing — that debt was paid #6426

Description

@claude

Observational finding, found while implementing #6373. Filed unassigned. No behaviour is affected — this is a stale claim in a test header that argues the next author OUT of writing a legitimate compile-time pin, which it nearly did here.

The claim (at 9602dc820)

packages/plugin-dashboard/src/__tests__/MetricWidget.domPassthrough.test.tsx, header:

this package's tests are compiled by nothing (tsconfig.json excludes **/*.test.tsx, the package is the sole remaining TEST_DEBT entry in scripts/check-type-check-coverage.mjs, and vitest erases types), which is objectui#3181 — assertions in an uncompiled test file read as coverage and are decoration. A @ts-expect-error written here would be especially dishonest: nothing would ever check that the error it expects still happens.

Measured — the debt it names was paid

  • packages/plugin-dashboard/tsconfig.test.json exists, includes src/**/*.test.ts / src/**/*.test.tsx, and its own header records the resolution: "This package was the last TEST_DEBT entry, so that table is now empty."
  • The package's type-check script chains it: tsc --noEmit && tsc -p tsconfig.test.json.
  • node scripts/check-type-check-coverage.mjs reports: test type-check coverage: 41/41 packages compile their tests, 0 declared debt.
  • Measured directly on this tree: tsc -p tsconfig.test.json --listFiles includes this package's test files, and a @ts-expect-error written in one of them IS checked — deliberately breaking the type it guards produced error TS2578: Unused '@ts-expect-error' directive.

So the two files disagree, and the stale half is the one a reader meets first.

Why it is worth fixing rather than leaving

The paragraph does not merely describe the old state — it prescribes: it tells the next author that a compile-time assertion in this package is decoration and that @ts-expect-error here would be dishonest. Both were true and are now false. #6373 needed exactly such a pin at this package's column emit seam, and this note is the reason it was nearly written somewhere else.

The neighbouring reasoning in the same header (why the DOM-passthrough assertions belong in ../domPassthroughPins.ts rather than in the test) may still stand on its own merits — that is for whoever picks this up to decide; only the "compiled by nothing" premise is measurably wrong.

Suggested disposition

Rewrite the paragraph to state today's arrangement, and check the sibling note in ObjectMetricWidget.i18nLabel.test.tsx (which cites unused-directive behaviour and is consistent with the tests being compiled) while there. Docs-only, so an empty-frontmatter changeset.

Related


Generated by Claude Code


Generated by Claude Code

Metadata

Metadata

Assignees

Labels

domain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seatpm:dispatched

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions