MCPcopy Create free account
hub / github.com/getsentry/XcodeBuildMCP / assertCliSnapshotProcessResult

Function assertCliSnapshotProcessResult

src/snapshot-tests/harness.ts:71–93  ·  view source on GitHub ↗
(
  result: Pick<ReturnType<typeof spawnSync>, 'error' | 'signal' | 'status' | 'stderr'>,
  label: string,
)

Source from the content-addressed store, hash-verified

69}
70
71export function assertCliSnapshotProcessResult(
72 result: Pick<ReturnType<typeof spawnSync>, 'error' | 'signal' | 'status' | 'stderr'>,
73 label: string,
74): void {
75 if (result.error) {
76 throw new Error(`CLI process failed for ${label}: ${result.error.message}`);
77 }
78
79 if (result.signal) {
80 throw new Error(`CLI process for ${label} was terminated by signal ${result.signal}.`);
81 }
82
83 if (result.status === null) {
84 throw new Error(
85 `CLI process exit status was null for ${label}; the process may have timed out or been killed by a signal.`,
86 );
87 }
88
89 const stderr = readProcessOutput(result.stderr).trim();
90 if (stderr.length > 0) {
91 throw new Error(`CLI process emitted unexpected stderr for ${label}:\n${stderr}`);
92 }
93}
94
95function parseStructuredEnvelope(
96 stdout: string,

Callers 2

invokeFunction · 0.85

Calls 1

readProcessOutputFunction · 0.85

Tested by

no test coverage detected