Skip to content

Keep Jest out of local agent worktrees - #111

Merged
arvida merged 1 commit into
mainfrom
chore/jest-ignore-claude
Oct 2, 2026
Merged

arvida merged 1 commit into
mainfrom
chore/jest-ignore-claude

Conversation

@arvida

@arvida arvida commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Agent worktrees under .claude/worktrees/ contain older copies of tests/, and Jest's testMatch picked them up: a local npm test ran 231 suites (4,296 tests) instead of the real 84 (1,454), so a stale copy could fail a release check for code that is fine.

Adds testPathIgnorePatterns: ['/node_modules/', '/.claude/']. Setting the option replaces Jest's default, so /node_modules/ is kept explicitly.

Verified: jest --listTests in a clone with two agent worktrees goes from 231 files to 84, none under .claude/ or node_modules/; full suite passes (1,454).

- Agent worktrees under .claude/ hold old copies of the tests, which ran alongside the real suite (231 suites instead of 84) and could fail a release check
- testPathIgnorePatterns replaces Jest's default, so /node_modules/ is listed too
@arvida
arvida merged commit 2f8d866 into main Oct 2, 2026
1 check passed
arvida added a commit that referenced this pull request Oct 8, 2026
* Stand down when a sync belongs to another app in the repo

- Send the config's projectId when fetching a sync; the server answers
  with project_matches (localheroai/localhero-ai#841)
- On a mismatch, print a notice and return before validating config,
  writing files, saving config, committing or completing the update
- Exit 0: a job that is not the target has nothing to do
- No project_matches from an older server: behave as before
- Real-filesystem test with two app folders, each with its own
  localhero.json

* Run tests inside an agent worktree

- Anchor the .claude ignore to <rootDir>, so the main checkout still
  skips worktree copies (#111) while a worktree no longer ignores itself
- Before, npm test in .claude/worktrees/<name> found no tests at all
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