Uh oh!
There was an error while loading. Please reload this page.
test(components): type-check the whole test tree, and retire the narrow typetests project (#4040) - #4355
Merged
Merged
Conversation
…ow typetests project (#4040) `@object-ui/components` gains a `tsconfig.test.json` chained from `type-check`, so its 119 test files are compiled by something for the first time. Measured at the branch point: 48 raw errors, 34 code-tier once the config-tier noise is gone — against a TEST_DEBT entry that declared 31. The registry's note for this package ("TS7006x12, TS7031x12 — untyped test callback params") turned out to be a misattribution worth recording: only TWO implicit-any sites are in the tests. The other 26 are untyped RENDERER params that appear only when a test project re-enables `noImplicitAny`, which this package's own build config deliberately disables. The new project mirrors that one flag and nothing else — a test project must not become the compiler of record for a source strictness decision `tsconfig.json` owns — and the 26 are filed as a finding rather than silently adopted or silently tightened. Of the 34, 21 are one mock-typing family: `ReturnType<typeof vi.fn>` resolves to the un-instantiated `Mock<Procedure | Constructable>`, which no handler prop accepts and whose `mock.calls[0]` is the empty tuple — so eight `api.mock.calls[0][0]` assertions about the dispatched ActionDef were reading element 0 of an empty tuple. Each mock is now typed with the signature the prop it feeds declares. Three fixtures disagreed with a declared type rather than with the compiler: `renderComponent(schema: SchemaNode)` read `.type` off a union whose members include `string | number | boolean | null | undefined`; `renderInForm(onSubmit: () => void)` was handed a one-parameter event handler by all three of its callers; and the row-menu planner's `editPredicates` fixture spelled `disabledWhen`, a key the planner's parameter type does not name (filed). Per #4291's ratchet, `tsconfig.typetests.json` is retired in the same PR. Refs #4040, #4291, #3181, #3009. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017Qqyix2QcnpUC9XeYVDzx3
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
… package self-import in the test project (#4040) Two errors CI's Type Check found that the local queue had not reached: - `page-header-actions.test.tsx`'s `onParamCollection` was the last zero-arity `vi.fn` in the file, so the assertion on the param DEFINITIONS it was handed read element 0 of the empty tuple. Typed `ParamCollectionHandler`. - `snapshot-critical.test.tsx` imports the package by its own name, the way a consumer does. With `paths: {}` that resolves through `exports` to `dist/index.d.ts` — which `type-check` must not depend on, because turbo has it wait on `^build` (dependencies), not on this package's own build. Mapped to `src/index.ts`, which is what the repo-root vitest config already aliases the same specifier to. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017Qqyix2QcnpUC9XeYVDzx3
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
This was referenced Aug 11, 2026
Merged
yinlianghui
marked this pull request as ready for review
August 11, 2026 21:12
github-merge-queueBot
removed this pull request from the merge queue due to a conflict with the base branch
Aug 11, 2026
… components removal is this PR's; retired-list union
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #4040 (tranche 4, package 2 of 2). Sibling: #4351 (
react). Refs #4291, #3181, #3009.@object-ui/componentsnow type-checks its whole test tree — 119 files that notscinvocation read. ItsTEST_DEBTentry is deleted and, per #4291'sratchet, its narrow
tsconfig.typetests.jsonis retired in the same PR.Remeasurement first, and the registry's note was wrong
libES2022 forArray.at,paths, …)Declared: 31. Measured: 34 — close, but for the wrong reason. The registry's
note read
TS7006x12, TS7031x12 — untyped test callback params, and thatattribution does not survive measurement:
strictgives 62 errors.anyerrors in that run, 26 are in package SOURCE(
sidebar.tsxx10,action-bar.tsxx6,action-menu.tsxx4,action-group.tsxx4,tree-view.tsxx2) and only 2 are in tests.They appear because a test file imports the package's own sources, so those
sources become program inputs — and this package's
tsconfig.jsonsetsnoImplicitAny: false, alone in the workspace. The new test project thereforemirrors that one flag and nothing else, with the reasoning inline: a TEST
project must not become the compiler of record for a SOURCE strictness decision
that the build config owns. Neither silently adopted nor silently tightened —
filed as #4353 with the per-file counts.
The 34
1. One mock-typing family (22).
let api: ReturnType< typeof vi.fn >resolves to the un-instantiated
Mock< Procedure | Constructable >. Twoconsequences, both live here: no handler prop accepts it (
TS2322x18 against(action: ActionDef, ctx: ActionContext) => Promise< ActionResult >), and itsmock.calls[0]is the EMPTY tuple — so ninemock.calls[0][0]reads, each ofwhich is the dispatched
ActionDef(or, inpage-header-action-i18n.test.tsx,the translated confirm message from #4265, and in
page-header-actions.test.tsxthe param DEFINITIONS handed to the collector) were indexing element 0 of
[].Every mock is now typed with the signature of the prop it feeds —
ConfirmationHandler,ToastHandler,ParamCollectionHandler, or thehandlersvalue type.2. Three helpers whose declared input contradicted every call (7).
renderComponent(schema: SchemaNode)intest-utils.tsxreadsschema.type,but
SchemaNodeisBaseSchema | string | number | boolean | null | undefined— four of those six have no
.type, and one isnull. Narrowed toBaseSchema, which is what all callers pass.renderInForm(onSubmit: () => void)is handedvi.fn((e) => e.preventDefault())by all three of its callers, and aone-parameter function is not assignable to a zero-parameter one. Typed
React.FormEventHandler< HTMLFormElement >, which is what theformelementit feeds actually declares.
filter-builder/ autotrigger sites of the same mock family.3. One fixture spelling a key its callee's parameter does not name (1).
data-table-row-menu-empty-guard's case still counts an item that rendersmerely DISABLED passed
editPredicates: { disabledWhen: … }, butplanDataTableRowMenudeclares{ visibleWhen?: unknown }— it decidesvisibility only. The case was vacuous: the planner never reads
disabledWhen, so its assertion holds identically for{}. The fixture is nowannotated with
DataTableSchema['rowEditPredicates'](derived, not hand-copied),so the same value reaches the planner the way it does in production and the
ignored key is stated rather than deleted. The underlying three-way restatement
is filed as #4354 — the case name is deliberately left alone rather than quietly
narrowed to what it actually pins.
4. One self-import (found by CI, not by the local queue).
snapshot-critical.test.tsximports the package by its own name, the way aconsumer does. With
paths: {}that resolves throughexportstodist/index.d.ts— an artifacttype-checkmust not depend on, since turbomakes it wait on
^build(the DEPENDENCIES' builds), not on this package's own.The test project maps that one specifier to
src/index.ts, which is exactlywhat the repo-root vitest config already aliases it to, so the compiler and the
runner see the same module.
Retiring the narrow project (#4291's ratchet)
Coverage —
tsc -p tsconfig.test.json --listFilesto a file, then grepped(never piped through
head):Discrimination —
type _Probe4040 = Assert< Equal< 1, 2 > >;appended tothat file in its own vocabulary, the FULL project run, then reverted:
Coverage moved, it did not vanish.
git statuswas empty afterwards.The surviving environment is equal or wider. Both projects
extendstheroot
tsconfig.json; the narrow one pinnedlib: ["ES2020","DOM"]andtypes: ["node"], the full one uses["ES2022","DOM","DOM.Iterable"]and adds@testing-library/jest-dom. The one option that is not wider —noImplicitAny: false— is inherited from the package build config, and theparity file it compiles contains no implicit-
anysite: its content isAssert< Equal< … > >pins and explicit declarations. The probe above confirmsit empirically rather than by argument.
Verification
node scripts/check-type-check-coverage.mjs— green on this branch:36/40 packages compile their tests, 4 declared debt (167 errors outstanding), 3 with a narrow type-assertion project.was piped through
head.Registry race
This PR and #4351 each delete one line from
TEST_DEBTinscripts/check-type-check-coverage.mjsand each append one name to theretired-narrow-project list in the gate's own suite. This branch keeps
@object-ui/react's entry (remeasured to 43) so the gate describes thisbranch; whichever PR lands second conflicts there, and GitHub silently disables
auto-merge on conflict, so it will need re-arming after the resolve (merge
origin/main, take main's registry minus this package's line, re-run thecoverage script, commit).
Also corrected here, since this is the last tranche-4 PR to touch the registry:
core72 to 56 andapp-shell53 to 62, both remeasured at this branch pointwith the config-tier split.
Changeset: empty frontmatter. Test files, checking-only tsconfig projects, one
type-checkscript and the coverage registry; nothing published changes.Generated by Claude Code