Skip to content

Commit da6e287

Browse files
thymikeeclaude
andcommitted
test(ios): prove the adapter carries the simulator set to the bridge start
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1 parent 8b4ff32 commit da6e287

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

‎packages/platform-apple/src/snapshot-source/adapter.test.ts‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,13 @@ test('the Simulator AX source returns raw acquisition facts and discloses unsupp
4747

4848
try {
4949
const result = await source.acquire({
50-
target: { ...sourceTarget, targetId: 'target-1' },
50+
target: { ...sourceTarget, targetId: 'target-1', simulatorSetPath: '/tmp/scoped-set' },
5151
hint,
5252
});
53+
assert.deepEqual(
54+
fixture.startedTargets.map((started) => started.simulatorSetPath),
55+
['/tmp/scoped-set'],
56+
);
5357
assert.equal(fixture.builds, 1);
5458
// Four identity probes and one clang build: the identity read execs one Xcode-owned binary.
5559
assert.equal(fixture.runs, 5);
@@ -465,6 +469,7 @@ type AdapterFixture = {
465469
omitViewport: boolean;
466470
omitRecovery: boolean;
467471
diagnostics: Record<string, unknown>[];
472+
startedTargets: Array<Parameters<SnapshotSourceHost['start']>[0]>;
468473
};
469474

470475
function targetForTest() {
@@ -492,6 +497,7 @@ function createAdapterHost(buildDelayMs = 0): AdapterFixture {
492497
omitViewport: false,
493498
omitRecovery: false,
494499
diagnostics: [],
500+
startedTargets: [],
495501
};
496502
const host: SnapshotSourceHost = {
497503
...realHost,
@@ -520,7 +526,10 @@ function createAdapterHost(buildDelayMs = 0): AdapterFixture {
520526
exitCode: 0,
521527
};
522528
},
523-
start: () => new AdapterProcess(),
529+
start: (target) => {
530+
fixture.startedTargets.push(target);
531+
return new AdapterProcess();
532+
},
524533
connect: async () => new AdapterSocket(fixture),
525534
readTargetProcessStartTime: async () => 'target-start',
526535
};

‎packages/platform-apple/src/snapshot-target.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function targetFixture() {
4242
runCommand,
4343
provider,
4444
resolve,
45-
discoveryCount: () => run.mock.calls.filter(([args]) => args[0] === 'spawn').length,
45+
discoveryCount: () => run.mock.calls.filter(([args]) => args.includes('spawn')).length,
4646
};
4747
}
4848

0 commit comments

Comments
 (0)