(
device: AgentDeviceSessionDevice,
options: { includeAndroidSerial?: boolean } = {},
)
| 45 | } |
| 46 | |
| 47 | function serializeSessionDevice( |
| 48 | device: AgentDeviceSessionDevice, |
| 49 | options: { includeAndroidSerial?: boolean } = {}, |
| 50 | ): Record<string, unknown> { |
| 51 | const includeAndroidSerial = options.includeAndroidSerial ?? true; |
| 52 | return { |
| 53 | platform: device.platform, |
| 54 | target: device.target, |
| 55 | device: device.name, |
| 56 | id: device.id, |
| 57 | ...(device.platform === 'ios' |
| 58 | ? { |
| 59 | device_udid: device.ios?.udid ?? device.id, |
| 60 | ios_simulator_device_set: device.ios?.simulatorSetPath ?? null, |
| 61 | } |
| 62 | : {}), |
| 63 | ...(device.platform === 'android' && includeAndroidSerial |
| 64 | ? { |
| 65 | serial: device.android?.serial ?? device.id, |
| 66 | } |
| 67 | : {}), |
| 68 | }; |
| 69 | } |
| 70 | |
| 71 | export function serializeSessionListEntry(session: AgentDeviceSession): Record<string, unknown> { |
| 72 | return { |
no outgoing calls
no test coverage detected