From 0a4d817039b0f8c1459637acca4c26a960d95bd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ch=C3=A1vez?= Date: Wed, 29 Apr 2026 18:39:00 +0900 Subject: [PATCH 1/4] jest: ignore .worktrees/ in haste-map indexing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- jest.config.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/jest.config.js b/jest.config.js index 1e13b56d427d..850089cb6cc8 100644 --- a/jest.config.js +++ b/jest.config.js @@ -19,6 +19,12 @@ module.exports = { '/node_modules/@expensify/react-native-live-markdown/lib/commonjs/parseExpensiMark.js', ], testPathIgnorePatterns: ['/node_modules'], + // Worktrees under .worktrees/ each contain their own modules/hybrid-app/package.json, + // which trips jest-haste-map's "duplicate manual mock" / "duplicate package name" + // assertion when local jest runs see all of them at once. Worktrees are dev-only + // (used by the agent-ctl pipeline + manual debugging) and never tested against + // directly — exclude them from haste-map indexing entirely. + modulePathIgnorePatterns: ['/.worktrees/'], globals: { __DEV__: true, WebSocket: {}, From c6cf1898003e1224049e74cb6a20b7f5695bc193 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ch=C3=A1vez?= Date: Thu, 30 Apr 2026 12:13:38 +0900 Subject: [PATCH 2/4] =?UTF-8?q?spellcheck:=20whitelist=20'worktrees'=20(pl?= =?UTF-8?q?ural)=20=E2=80=94=20'worktree'=20singular=20already=20in=20dict?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- cspell.json | 1 + 1 file changed, 1 insertion(+) diff --git a/cspell.json b/cspell.json index 270bb07490c7..9e577b274c5c 100644 --- a/cspell.json +++ b/cspell.json @@ -845,6 +845,7 @@ "workshopping", "workspacename", "worktree", + "worktrees", "writeitdown", "xcconfig", "xcodeproj", From 59ba265bb1f60c8bbae947d042569c66d1df77c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ch=C3=A1vez?= Date: Thu, 30 Apr 2026 14:04:06 +0900 Subject: [PATCH 3/4] Reword .worktrees/ comment without naming internal tooling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- jest.config.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/jest.config.js b/jest.config.js index 850089cb6cc8..f4a0e0b3a9e9 100644 --- a/jest.config.js +++ b/jest.config.js @@ -19,11 +19,12 @@ module.exports = { '/node_modules/@expensify/react-native-live-markdown/lib/commonjs/parseExpensiMark.js', ], testPathIgnorePatterns: ['/node_modules'], - // Worktrees under .worktrees/ each contain their own modules/hybrid-app/package.json, - // which trips jest-haste-map's "duplicate manual mock" / "duplicate package name" - // assertion when local jest runs see all of them at once. Worktrees are dev-only - // (used by the agent-ctl pipeline + manual debugging) and never tested against - // directly — exclude them from haste-map indexing entirely. + // .worktrees/ is a local-dev-only directory: developers may check out parallel + // branches there as git worktrees. Each worktree carries its own copy of + // modules/hybrid-app/package.json, which trips jest-haste-map's "duplicate + // manual mock" / "duplicate package name" assertion when a local jest run + // sees all of them at once. CI never creates worktrees, so this only affects + // local runs — exclude them from haste-map indexing entirely. modulePathIgnorePatterns: ['/.worktrees/'], globals: { __DEV__: true, From 9433ea63b1e8ac19b40eb5cbe3f99341570f66c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ch=C3=A1vez?= Date: Thu, 30 Apr 2026 14:05:43 +0900 Subject: [PATCH 4/4] Tighten .worktrees/ comment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Drop the redundant 'CI never creates worktrees' clause — already implied by 'developer may check out locally'. Trim from 6 lines to 3. --- jest.config.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/jest.config.js b/jest.config.js index f4a0e0b3a9e9..2f7c9a810b21 100644 --- a/jest.config.js +++ b/jest.config.js @@ -19,12 +19,9 @@ module.exports = { '/node_modules/@expensify/react-native-live-markdown/lib/commonjs/parseExpensiMark.js', ], testPathIgnorePatterns: ['/node_modules'], - // .worktrees/ is a local-dev-only directory: developers may check out parallel - // branches there as git worktrees. Each worktree carries its own copy of - // modules/hybrid-app/package.json, which trips jest-haste-map's "duplicate - // manual mock" / "duplicate package name" assertion when a local jest run - // sees all of them at once. CI never creates worktrees, so this only affects - // local runs — exclude them from haste-map indexing entirely. + // .worktrees/ holds parallel git worktrees a developer may check out locally. + // Each one carries its own modules/hybrid-app/package.json, which trips + // jest-haste-map's "duplicate package name" assertion. Skip them entirely. modulePathIgnorePatterns: ['/.worktrees/'], globals: { __DEV__: true,