Skip to content

Commit d3dc260

Browse files
committed
test(apple): keep the snapshot-target compile proof in the lifecycle fixtures
The rebase onto main put lifecycle.test.ts one line over the 1000-line lint limit. The compile-time SnapshotSourceTarget proof is not a lifecycle test, so it moves to the fixtures, which are type-checked the same way.
1 parent e4cb649 commit d3dc260

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

‎packages/platform-apple/src/snapshot-source/lifecycle.fixtures.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import type {
1515
SnapshotSourceLimits,
1616
SnapshotSourceProcess,
1717
SnapshotSourceSocket,
18+
SnapshotSourceTarget,
1819
} from './types.ts';
1920

2021
export const limits: SnapshotSourceLimits = {
@@ -360,3 +361,10 @@ class FakeSocket extends EventEmitter implements SnapshotSourceSocket {
360361
queueMicrotask(() => this.emit('close'));
361362
}
362363
}
364+
365+
/** The target type refuses a bare udid: a target names its simulator through an address minted from its DeviceInfo. */
366+
function compileTimeSnapshotTargetProof(): SnapshotSourceTarget {
367+
// @ts-expect-error A target names its simulator through an address minted from its DeviceInfo.
368+
return { udid: 'simulator-1', runtime: 'iOS 26.2', pid: 123, generation: 'generation-1' };
369+
}
370+
void compileTimeSnapshotTargetProof;

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { SnapshotSourceError } from '@agent-device/capture-kit/snapshot-source-c
44
import { snapshotSourceError } from './errors.ts';
55
import { SnapshotBridgeManager } from './lifecycle.ts';
66
import { simulatorAddressFor } from '../core/simctl.ts';
7-
import type { SnapshotSourceTarget } from './types.ts';
87
import {
98
limits,
109
simulatorDevice,
@@ -21,12 +20,6 @@ import {
2120
createLifecycleFixture,
2221
} from './lifecycle.fixtures.ts';
2322

24-
function compileTimeSnapshotTargetProof(): SnapshotSourceTarget {
25-
// @ts-expect-error A target names its simulator through an address minted from its DeviceInfo.
26-
return { udid: 'simulator-1', runtime: 'iOS 26.2', pid: 123, generation: 'generation-1' };
27-
}
28-
void compileTimeSnapshotTargetProof;
29-
3023
test('the bridge manager reuses a healthy per-device helper and stops it exactly once', async () => {
3124
const fixture = createLifecycleFixture();
3225
const manager = new SnapshotBridgeManager(fixture.host);

0 commit comments

Comments
 (0)