Skip to content

test(frontend): give each failure-text test its types, also with CI=true - #546

Merged
pdevito3 merged 1 commit into
mainfrom
fix/failure-text-lint-tests
Nov 22, 2026
Merged

pdevito3 merged 1 commit into
mainfrom
fix/failure-text-lint-tests

Conversation

@pdevito3

Copy link
Copy Markdown
Owner

Why

The api-contract and without-examples jobs fail on main since #543. Six messages/failure-text cases in frontend/eslint.config.test.js get no report in CI, and pass locally.

What changed

failureTextMessages in the test sets disallowAutomaticSingleRunInference: true on its own ESLint.

With CI=true, typescript-eslint infers a single run. In that mode it counts the parses of each path, and takes each parse after the first for a --fix pass, so it gives the file an isolated program with no imports and no default lib. Every test lints the same path, src/components/query-error.tsx, so each test after the first got no types, and isError and isProblemText found nothing. The first case, which needs no types, passed.

Blast Radius

Test only. eslint.config.js is unchanged, and pnpm lint in CI parses each file once, so the rule keeps its types there.

Verification

  • Reproduced the six failures locally with CI=true pnpm vitest run eslint.config.test.js.
  • After the change: 92 of 92 pass with CI=true and without it, and CI=true pnpm test passes 910 of 910. pnpm lint is clean.

With CI=true, typescript-eslint infers a single run. It takes each lint of
a path after the first for a --fix pass and gives it an isolated program
with no types. Each test lints the same path, so the type-aware cases of
messages/failure-text found nothing in CI. The test's ESLint turns off the
inference.

Amp-Thread-ID: https://ampcode.com/threads/T-01a2045d-65f9-767c-a723-e94e1f37f5d4
Co-authored-by: Amp <amp@ampcode.com>

Copy link
Copy Markdown
Owner Author

review-gate: passed e47317c

Independent review found no high or medium findings. One low finding: the code comment named the wrong cause (single run types the file on disk). The real cause is single run's per-path parse count, which gives each lint after the first an isolated program with no types. Fixed in 5a17c87 (comment and commit message).

@pdevito3
pdevito3 merged commit eef1257 into main Nov 22, 2026
16 checks passed
@pdevito3
pdevito3 deleted the fix/failure-text-lint-tests branch November 22, 2026 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant