Skip to content

test(e2e-type-check): bring the four root playwright configs into tsconfig.e2e.json - #5948

Merged
os-warren merged 1 commit into
mainfrom
claude/issue-4477-playwright-configs-in-tsconfig
Aug 24, 2026
Merged

test(e2e-type-check): bring the four root playwright configs into tsconfig.e2e.json#5948
os-warren merged 1 commit into
mainfrom
claude/issue-4477-playwright-configs-in-tsconfig

Conversation

@os-warren

Copy link
Copy Markdown
Collaborator

Fixes#4477

The four root playwright*.config.ts files sit beside tsconfig.e2e.json rather than under e2e/, so its e2e/**/*.ts glob did not reach them — and neither did the root tsconfig.json (packages/examples/apps), tsconfig.scripts.json, or tsconfig.vitest-setup.json. turbo run type-check walks package.json scripts, and the repo root is not a workspace package. So the files that decide which specs run, where they run, and what webServer command builds the app under test were read by no compiler.

What changed

  • tsconfig.e2e.json"include": ["e2e/**/*.ts", "playwright*.config.ts"]. The program root set goes from 30 files to 34.
  • tsconfig.e2e.json header — the paragraph declaring the four configs "NOT covered here, deliberately … filed as objectui#4477 instead" became false the moment this lands, so it is replaced by what is now true, with the re-measurement recorded.
  • scripts/__tests__/e2e-type-check.test.ts — the on-disk coverage sweep gains its root-config half (+2 tests, 12 → 14).

The four configs themselves are untouched: nothing surfaced in them to fix.

Re-measurement: still zero errors, twelve days later

The card measured exit=0 against this exact option set on 2026-08-12. Re-measured on the widened config at 014b3e0:

$ pnpm type-check:e2e # tsc -p tsconfig.e2e.json
exit=0, no diagnostics
$ npx tsc -p tsconfig.e2e.json --listFiles | grep -v /node_modules/ | wc -l
34 # 30 under e2e/ + the four root configs

That 34 is also the parse-failure canary: a tsconfig that fails to parse does not fail loudly, it falls back to compiling the entire repository. Comments in this file stay // for the same reason.

Zero errors is the point rather than a disappointment. What was missing was never a fix, it was the gate: Playwright transpiles a config rather than checking it, so a defineConfig option that stops existing — or is misspelled into undefined — is read as intent and surfaces only as a confusing runtime failure in the e2e job.

The sweep asserts by glob, never by a list of four names

Two tests, and the second is the load-bearing one:

  1. resolves every root playwright*.config.ts on disk, with none left out — discovers the root configs with readdirSync + /^playwright.*\.config\.ts$/ (a faithful translation of the tsconfig glob: * does not cross a path separator, so the walk must not descend either), then set-differences them against the program TypeScript itself resolves. Non-vacuity floor first, for the same reason the e2e/ sweep carries one.
  2. would resolve a FIFTH root config that nobody has written yet — copies the real tsconfig.e2e.json into a throwaway tree containing playwright.not-yet-written.config.ts and asks whether the program resolves it. A throwaway tree rather than the repo root, because a transient .ts at the real root is visible to every other guard that enumerates it.

Test 1 alone would be satisfied by an include that names today's four files, and then the next config to land would sit outside every program again — the exact defect. Reverse-verified, both directions, at 014b3e0:

mutationresult
include narrowed back to ["e2e/**/*.ts"]2 failed / 12 passed — both new tests red
include replaced by the four literal filenames1 failed / 13 passed — only the fifth-config probe red
(unmutated)14 passed

Each mutation was confirmed on disk by grep before the run, and reverted through a trap … EXIT INT TERM.

Gate results, each by name, at 014b3e0

gateconclusion
pnpm type-check:e2eexit=0, no diagnostics; program root set 34 files
npx vitest run scripts/__tests__/e2e-type-check.test.ts (repo root)Test Files 1 passed (1) · Tests 14 passed (14)
npx vitest run scripts/__tests__ (repo root, full meta-gate suite)Test Files 62 passed (62) · Tests 1664 passed (1664)
pnpm type-check:scriptsexit=0 — this test file is in that program
pnpm lint:rootexit=026 problems (0 errors, 26 warnings), all pre-existing, none in the changed files
node scripts/check-type-check-coverage.mjsexit=045/46 via type-check · 41/41 packages compile their tests
node scripts/check-changeset-presence.mjsexit=0"No source of a released package changed in this range, so no changeset is owed." No changeset added, per that verdict
control-byte scan (grep -naP over both changed files)no matches

Full pnpm type-check was not run locally: it is turbo run type-check with dependsOn: ["^build"], i.e. a whole-repo build. CI runs it. What was verified instead is that it really reaches this config — below.

The gate actually runs in CI, verified rather than assumed

turbo run type-check --dry=json at this commit resolves an 83-task graph containing //#type-check:e2e, command tsc -p tsconfig.e2e.json, cache.local=false/cache.remote=false, with every package's type-check as a dependent. ci.yml's existing Run type-check step runs pnpm type-check. So the widened include is covered with no workflow change, which is the shape objectui#4456 introduced for //#lint:root.

Premises checked, not inherited

  • The project stays standalone: all four configs import only @playwright/test, and the existing imports no workspace package, so it needs no build assertion now covers them automatically (it iterates the program's fileNames). No @object-ui/* import was dragged in, so //#type-check:e2e still needs no ^build.
  • The shared option set was not touched — no file needed it loosened.
  • No file outside the ruled surface was edited. scripts/check-doc-snippet-types.mjs, content/docs/** and the root vitest.setup* files are untouched.

Generated by Claude Code


Generated by Claude Code

…onfig.e2e.json
The four `playwright*.config.ts` files sit beside `tsconfig.e2e.json` rather
than under `e2e/`, so its `e2e/**` glob did not reach them and no other tsc
program did either — the objectui#4471 gap one directory up.
Widen the include to `["e2e/**/*.ts", "playwright*.config.ts"]` (zero errors:
they compile clean against this exact option set) and extend the on-disk
coverage sweep to discover the root configs rather than list them, plus a probe
that asks the real config whether it would resolve a fifth config nobody has
written yet.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PQ3NihCHE9LUtHoGxo6A9f
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The four root playwright*.config.ts files are in no tsconfig program either — the #4471 gap, one directory up

2 participants

@os-warren@claude