Skip to content

docs: document jest suite load-flakiness and worktree test gotchas - #372

Open
RonenMars wants to merge 1 commit into
mainfrom
docs/jest-suite-verification
Open

docs: document jest suite load-flakiness and worktree test gotchas#372
RonenMars wants to merge 1 commit into
mainfrom
docs/jest-suite-verification

Conversation

@RonenMars

Copy link
Copy Markdown
Owner

Two testing gotchas cost real time during the 2026-07-22 integration snapshot and were only recorded in a throwaway snapshot branch.
This moves them somewhere durable.

Batch failures that aren't real — and the ones that are

The SessionScreen.* suites each render the full session screen with fake timers, WebSocket stubs and long backstop timeouts.
Jest's default parallel workers oversubscribe some machines, so a batch run reports failures that a single-suite run does not.

The trap runs in both directions, which is the part worth writing down.
During the snapshot, four genuinely broken suites were nearly dismissed as flakes on this basis, while two others really were load artifacts — and the batch output looked the same either way.
The rule is therefore not "use --runInBand" but "never classify a batch failure without re-running that suite alone": passes alone means artifact, fails alone means real.

Also lists the suites currently known to be load-sensitive, so they are not re-investigated from scratch.

npx jest finds 0 tests in a worktree under .claude/

testPathIgnorePatterns excludes \.claude\, so every test path inside such a worktree is filtered out and scripts like npm run test:i18n look broken when they are not.
Documents the fix (create worktrees outside .claude/), the override for running in place, and the caveat that the override re-enables __tests__/unit/scripts/, which the main config excludes deliberately.

Scope

Documentation only — no code, config or workflow changes.
docs/troubleshooting.md gains a "Jest test suites" section matching the existing symptom / When / Cause / Fix format, and CLAUDE.md gains a short rule pointing at it.

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