Summary
The InstallPods command (src/extension/commands/installPods.ts) has 257 lines of logic but no dedicated unit test file. It contains several well-isolated, independently testable code paths that are not covered by the existing smoke tests.
Why this is useful
Unit tests would guard against regressions in the platform guard, directory validation, pod discovery, and error suggestion logic — all without requiring a macOS environment or a real CocoaPods installation.
Suggested scope
- Test non-darwin platform early exit (warns and returns without executing)
- Test missing
ios/ directory handling (logs error, shows error message, returns)
- Test missing
Podfile handling (logs error, shows error message, returns)
- Test
findPodCommand(): returns a known path when a file exists and is executable, falls back to "pod" when nothing is found
- Test
getSuggestionForError(): each error-keyword branch returns the expected suggestion string
- Follow the
proxyquire / sinon stub pattern used in stopPackager.test.ts and cleanRestartPackager.test.ts
Evidence
- Source:
src/extension/commands/installPods.ts — added in v1.13.2, grown to 257 lines with three private helpers (findPodCommand, getEnhancedEnvironment, getSuggestionForError)
- No test file exists under
test/extension/commands/ for this command
- The recent test-addition series has systematically covered
startPackager, stopPackager, cleanRestartPackager, stopLogCatMonitor, prebuildClean, setNewArch, enableExpoHermes — installPods is the natural next command in this series
- CHANGELOG v1.14.1 confirms the test backfill initiative is active
Validation
- Run
npx mocha --config .mocharc.js test/extension/commands/installPods.test.ts (or equivalent test runner invocation) and confirm all new test cases pass
Summary
The
InstallPodscommand (src/extension/commands/installPods.ts) has 257 lines of logic but no dedicated unit test file. It contains several well-isolated, independently testable code paths that are not covered by the existing smoke tests.Why this is useful
Unit tests would guard against regressions in the platform guard, directory validation, pod discovery, and error suggestion logic — all without requiring a macOS environment or a real CocoaPods installation.
Suggested scope
ios/directory handling (logs error, shows error message, returns)Podfilehandling (logs error, shows error message, returns)findPodCommand(): returns a known path when a file exists and is executable, falls back to"pod"when nothing is foundgetSuggestionForError(): each error-keyword branch returns the expected suggestion stringproxyquire/ sinon stub pattern used instopPackager.test.tsandcleanRestartPackager.test.tsEvidence
src/extension/commands/installPods.ts— added in v1.13.2, grown to 257 lines with three private helpers (findPodCommand,getEnhancedEnvironment,getSuggestionForError)test/extension/commands/for this commandstartPackager,stopPackager,cleanRestartPackager,stopLogCatMonitor,prebuildClean,setNewArch,enableExpoHermes—installPodsis the natural next command in this seriesValidation
npx mocha --config .mocharc.js test/extension/commands/installPods.test.ts(or equivalent test runner invocation) and confirm all new test cases pass