Skip to content

chore(jest): keep haste map out of .claude agent worktrees - #99

Merged
sjsyrek merged 1 commit into
mainfrom
chore/jest-ignore-claude-worktrees
Jul 28, 2026
Merged

chore(jest): keep haste map out of .claude agent worktrees#99
sjsyrek merged 1 commit into
mainfrom
chore/jest-ignore-claude-worktrees

Conversation

@sjsyrek

@sjsyrek sjsyrek commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Silences the jest-haste-map: duplicate manual mock found: version warning emitted on every test run while an agent worktree exists under .claude/worktrees/ (sync-8mqh.9 item 2).

Changes Made

  • jest.config.js — added modulePathIgnorePatterns: ['<rootDir>/.claude/']. testPathIgnorePatterns already excluded worktree test files, but haste-map module indexing still scanned the worktree and found a second copy of tests/__mocks__/version.ts.
  • CHANGELOG.md — entry under Unreleased.

Test Coverage

Verified empirically with the leftover agent-a88d04d1 worktree still present: warning count went from 1 per run to 0, and the touched suite passes (62/62). The fix is worth keeping even after that worktree is removed, since agent worktrees recur by design.

Backward Compatibility

✅ No behavior change — .claude/ contains no modules the suite resolves.

Size: Small ✓

One config line.

🤖 Generated with Claude Code

testPathIgnorePatterns already excluded worktree test files, but jest
still indexed their modules, so a leftover worktree's copy of
tests/__mocks__/version.ts triggered "duplicate manual mock found" on
every run. modulePathIgnorePatterns closes the gap permanently, since
agent worktrees may recur. Verified warning-free with a worktree present.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@sjsyrek
sjsyrek merged commit 57f4e30 into main Jul 28, 2026
5 checks passed
@sjsyrek
sjsyrek deleted the chore/jest-ignore-claude-worktrees branch July 28, 2026 15:22
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