( logPath: string, flags: CommandFlags | undefined, appBundleId?: string, traceLogPath?: string, requestId?: string, meta?: DaemonRequest['meta'], )
| 14 | // context drift easier to spot than splitting the same optional fields apart. |
| 15 | // fallow-ignore-next-line complexity |
| 16 | export function contextFromFlags( |
| 17 | logPath: string, |
| 18 | flags: CommandFlags | undefined, |
| 19 | appBundleId?: string, |
| 20 | traceLogPath?: string, |
| 21 | requestId?: string, |
| 22 | meta?: DaemonRequest['meta'], |
| 23 | ): DaemonCommandContext { |
| 24 | const effectiveRequestId = requestId ?? getDiagnosticsMeta().requestId; |
| 25 | return { |
| 26 | requestId: effectiveRequestId, |
| 27 | appBundleId, |
| 28 | runnerLeaseContext: resolveRunnerLogicalLeaseContext({ meta }), |
| 29 | activity: flags?.activity, |
| 30 | launchConsole: flags?.launchConsole, |
| 31 | launchArgs: flags?.launchArgs, |
| 32 | clearAppState: flags?.clearAppState, |
| 33 | verbose: flags?.verbose, |
| 34 | logPath, |
| 35 | traceLogPath, |
| 36 | iosXctestrunFile: flags?.iosXctestrunFile, |
| 37 | iosXctestDerivedDataPath: flags?.iosXctestDerivedDataPath, |
| 38 | iosXctestEnvDir: flags?.iosXctestEnvDir, |
| 39 | snapshotInteractiveOnly: flags?.snapshotInteractiveOnly, |
| 40 | snapshotDepth: flags?.snapshotDepth, |
| 41 | snapshotScope: flags?.snapshotScope, |
| 42 | snapshotRaw: flags?.snapshotRaw, |
| 43 | ...screenshotFlagsFromOptions(flags), |
| 44 | count: flags?.count, |
| 45 | intervalMs: flags?.intervalMs, |
| 46 | delayMs: flags?.delayMs, |
| 47 | durationMs: flags?.durationMs, |
| 48 | holdMs: flags?.holdMs, |
| 49 | jitterPx: flags?.jitterPx, |
| 50 | pixels: flags?.pixels, |
| 51 | doubleTap: flags?.doubleTap, |
| 52 | clickButton: resolveClickButton(flags), |
| 53 | backMode: flags?.backMode, |
| 54 | pauseMs: flags?.pauseMs, |
| 55 | pattern: flags?.pattern, |
| 56 | }; |
| 57 | } |
no test coverage detected