[No QA] jest: ignore .worktrees/ in haste-map indexing#89161
Merged
marcochavezf merged 5 commits intomainfrom May 1, 2026
Merged
[No QA] jest: ignore .worktrees/ in haste-map indexing#89161marcochavezf merged 5 commits intomainfrom
marcochavezf merged 5 commits intomainfrom
Conversation
Worktrees under .worktrees/ each contain their own modules/hybrid-app/package.json, which trips jest-haste-map's duplicate-manual-mock assertion when local jest runs see all of them at once. Worktrees are dev-only and never tested against directly — exclude them from haste-map indexing entirely. Verified: jest tests/unit/hooks/usePendingConciergeResponse.test.ts runs cleanly (6 tests, 65s) after this change. Prior to fix: 'duplicate manual mock found: index' assertion failure with 0 tests run.
|
@AndrewGable Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Contributor
|
Can you resolve the failing test please? |
…ady in dict Andrew flagged the failing spellcheck on this PR — comment in jest.config.js uses both 'Worktrees' and 'worktrees' (plural) which weren't in cspell.json. The singular 'worktree' was already there; adding the plural keeps consistency without churning the comment.
…te-ignore-worktrees
Drop the agent-ctl reference — that is internal-only and unfamiliar to external readers. The comment now describes the rule in dev-only terms that stand on their own.
Drop the redundant 'CI never creates worktrees' clause — already implied by 'developer may check out locally'. Trim from 6 lines to 3.
Contributor
Author
|
Tests passing |
AndrewGable
approved these changes
Apr 30, 2026
Contributor
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
Contributor
|
🚧 @marcochavezf has triggered a test Expensify/App build. You can view the workflow run here. |
Contributor
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
Contributor
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Contributor
|
🚀 Deployed to staging by https://github.com/marcochavezf in version: 9.3.66-0 🚀
|
77 tasks
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.
Explanation of Change
When developers use git worktrees under
App/.worktrees/<name>/for parallel branch work, every worktree contains its own copy ofmodules/hybrid-app/package.json(becausemodules/is checked into the repo). Jest's haste-map indexer scans the project root and trips its "duplicate manual mock found: index" / "duplicate package name" assertion when it sees more than one of these — localnpx jestexits with 0 tests run.This adds
modulePathIgnorePatterns: ['<rootDir>/.worktrees/']tojest.config.jsso haste-map skips worktree paths entirely. CI is unaffected (the runner doesn't use worktrees).Fixed Issues
$
PROPOSAL: N/A (developer-environment-only change; no user-visible behavior)
Tests
App/.worktrees/, runnpx jest tests/unit/hooks/usePendingConciergeResponse.test.ts --no-coverage. Verify it executes the 6 binary-path tests in ~65s instead of failing with a "duplicate manual mock found: index" assertion.npx jest --listTests | wc -lfrom the App root and confirm the count matches the pre-change count (i.e. no production tests are filtered out — only worktree paths are excluded).Offline tests
N/A — config change.
QA Steps
No QA — developer-only change; CI test infrastructure isn't affected.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
N/A — jest config change, no UI.