Conversation
… (kaizen qwibitai#343) The test was fragile because vi.mock() declarations had to exactly mirror every export used at module scope in index.ts. When #285 extracted inline logic into new modules, adding those imports broke the test. Changes: - Add mocks for all 12 modules imported by index.ts but previously unmocked (case-backend, case-backend-github, escalation-hook, case-sync-routing, cookie-handler, record-usage, dev-safe-word, dev-session-orchestrator, dev-session-router, error-classify, message-dispatch, send-response) - Add missing exports to existing mocks (checkImageAdvisory, routeOutboundImage, routeOutboundDocument, CASE_SYNC_ENABLED, CASE_SYNC_REPO, etc.) - Add maintenance note explaining the pattern for future additions batch-260321-1108-3ef8/run-10 Co-Authored-By: Claude Opus 4.6 (1M context) <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
Problem
When #285 extracted inline logic from index.ts into new modules, adding those imports broke index-response-deps.test.ts because its vi.mock() declarations had to exactly mirror every module-scope import. This created a maintenance tax that grows with each extraction.
Solution
Mock all currently-imported modules and document the pattern. Future extractions only need to add a single
vi.mock('./new-module.js', () => ({...}))line.Test plan
batch-260321-1108-3ef8/run-10
🤖 Generated with Claude Code