Skip to content

Commit 0faf2bd

Browse files
baozhoutaoclaude
andauthored
docs(scripts): name the rootDir widening in TESTS_COVERED's remedy (#14943) (#15129)
`check:type-check-coverage`'s TESTS_COVERED failure text names the sibling `tsconfig.test.json` route but not the `rootDir` widening that route can require, so the remedy is incomplete for exactly the packages that need it. Measured on #14835: with `rootDir` inherited the honest program reported 116 x TS6059, and `"."` still left 3. PR #14833 resolved it with `rootDir: "../.."`, the shape `packages/client`'s test config already used — a precedent no author could reach from the gate's message. Remedy prose only: the predicate is untouched, and what the gate accepts does not move. Claude-Session: https://claude.ai/code/session_012zGPuVVX3deAx9LdjK8jCk Co-authored-by: Claude <noreply@anthropic.com>
1 parent fcc42e6 commit 0faf2bd

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

scripts/check-type-check-coverage.mjs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,12 @@ const PIN_ISSUE = 'https://github.com/objectstack-ai/objectstack/issues/5286';
590590
// finding later used ("the directory was never INCLUDED by anything"), which is
591591
// why the remedy names a file rather than describing a shape (#10756).
592592
const SPEC_SCRIPTS_PRECEDENT = 'packages/spec/tsconfig.scripts.json';
593+
// The in-tree precedents TESTS_COVERED's remedy points at for the `rootDir`
594+
// half of the sibling-config route. Both put a test tree that sits outside the
595+
// build config's `rootDir` into a program, and both had to widen `rootDir` to
596+
// the repo root to do it -- the step the remedy named no way to discover until
597+
// #14943, measured on #14835 at 116 x TS6059 inherited and 3 more at `"."`.
598+
const TEST_ROOTDIR_PRECEDENT = '`packages/client/tsconfig.test.json` and `packages/cli/tsconfig.test.json`';
593599
const GENERATED_INCLUDE_ISSUE = 'https://github.com/objectstack-ai/objectstack/issues/10880';
594600

595601
// A path in the root program whose edits move the `@objectstack/spec-monorepo`
@@ -2004,7 +2010,13 @@ function evaluate(packages, root, state) {
20042010
`the check reports green over source it never read (${TRACKING_ISSUE}). Drop the ` +
20052011
`\`*.test.ts\`/\`*.spec.ts\` entry from \`exclude\`, widen \`include\` to reach the test tree, add a ` +
20062012
`sibling \`tsconfig.test.json\` and name it in the \`typecheck\` script (the #5286 route, when the ` +
2007-
`build config must keep the exclusion), or measure what surfaces and add a TEST_DEBT entry in ${SELF}.`,
2013+
`build config must keep the exclusion), or measure what surfaces and add a TEST_DEBT entry in ${SELF}. ` +
2014+
`⚠️ The sibling route usually needs \`rootDir\` widened as well, and leaving it inherited is the ` +
2015+
`way that route fails: test files outside the build config's \`rootDir\` report one TS6059 each -- ` +
2016+
`116 of them in one measured onboarding of a sibling \`test/\` tree under \`rootDir: "src"\`, and ` +
2017+
`\`"."\` still left 3 where tests read fixtures from another package. ${TEST_ROOTDIR_PRECEDENT} ` +
2018+
`widen it to \`"../.."\` (the repo root) for exactly this reason; \`rootDir\` steers emit layout ` +
2019+
`only and these programs emit nothing, so it widens the ROOT and never the strictness.`,
20082020
);
20092021
} else {
20102022
const entry = state.testDebt[pkg.name];

0 commit comments

Comments
 (0)