chore(jest): keep haste map out of .claude agent worktrees - #99
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Silences the
jest-haste-map: duplicate manual mock found: versionwarning emitted on every test run while an agent worktree exists under.claude/worktrees/(sync-8mqh.9 item 2).Changes Made
jest.config.js— addedmodulePathIgnorePatterns: ['<rootDir>/.claude/'].testPathIgnorePatternsalready excluded worktree test files, but haste-map module indexing still scanned the worktree and found a second copy oftests/__mocks__/version.ts.CHANGELOG.md— entry under Unreleased.Test Coverage
Verified empirically with the leftover
agent-a88d04d1worktree 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