Repository navigation
refactor(platform-apple): split apps.test.ts by the module each test covers - #3671
Merged
Merged
Conversation
…covers The 24 tests covered app-launch, the macOS helper, screenshot, app-resolution and app-device-io. Each group now sits beside its module; shared mock setup is carried only by the files that need it. Test count is 24 before and after. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Size Report
Startup median (7 runs, lower is better):
|
Member
Author
|
This PR is ready at 1450b84. The split is test-only, and the moved test titles and added lines match the original |
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
platform-apple/src/core/__tests__/apps.test.ts(24 tests, 674 lines) covered six modules and sat beside none of them. It is split so each group sits beside the module it exercises. This was the largest remaining colocation offender in platform-apple (with #3657 the package reaches 0).This is a split, not a move: one commit, all content is relocated test bodies verbatim plus the minimum scaffolding each file needs.
Split
core/__tests__/app-launch-open.test.tsopenIosApp)core/app-launch.tscore/__tests__/app-launch-close-quit.test.tscloseIosAppon macOS helper quit, simulator terminate bound)core/app-launch.tscore/__tests__/screenshot-simulator-capture.test.tsscreenshotIosretry, pixel density)core/screenshot.tscore/__tests__/app-resolution-display-name.test.tsresolveIosApp×2,resolveIosSimulatorDeepLinkBundleId)core/app-resolution.tscore/__tests__/app-device-io-physical-device.test.tsreadIosClipboardText)core/app-device-io.tsos/macos/helper-resolution.test.tsresolveMacOsHelperPackageRootFrom, relativeAGENT_DEVICE_MACOS_HELPER_BIN,quitMacOsAppvalidation)os/macos/helper.tsMock setup is carried only where used: the
runCmd/ensureBootedSimulatormocks andbeforeEachlive in the open and close files, theretryWithPolicymock only in the screenshot file, and the resolution, clipboard and helper files use none (their tests ran the pass-through mock's real implementation).Test-count parity (
vitest --reporter=json)apps.test.ts24/24 → 13 + 2 + 2 + 3 + 1 + 3 = 24/24 across 6 files. All new files are underpackages/platform-apple/src/**, sounit-coreselects them;check:affected --runpassed with them selected.vi.mockeffectivenessEach mock swapped for a module that does not provide the behavior, one at a time, then reverted:
app-launch-open@agent-device/host-kit/command../simulator.tsapp-launch-close-quit@agent-device/host-kit/command../simulator.tsscreenshot-simulator-capture@agent-device/host-kit/retrySurface
exportsunchanged (no manifest touched). Colocation offenders:apps.test.tsremoved; the file's six replacements are all module-named.Gates
pnpm check:quick,check:layering,check:fallow,check:gate-manifestandcheck:affected --runall exit 0 on this head;pnpm formatleaves a clean tree.🤖 Generated with Claude Code