MCPcopy Index your code
hub / github.com/getsentry/XcodeBuildMCP / expectPendingBuildResponse

Function expectPendingBuildResponse

src/test-utils/test-helpers.ts:183–220  ·  view source on GitHub ↗
(
  result: ToolResponse | MockToolHandlerResult,
  nextStepToolId?: string,
)

Source from the content-addressed store, hash-verified

181}
182
183export function expectPendingBuildResponse(
184 result: ToolResponse | MockToolHandlerResult,
185 nextStepToolId?: string,
186): void {
187 if (isMockToolHandlerResult(result)) {
188 expect(result.text().trim().length).toBeGreaterThan(0);
189
190 if (nextStepToolId) {
191 expect(result.nextStepParams).toEqual(
192 expect.objectContaining({
193 [nextStepToolId]: expect.any(Object),
194 }),
195 );
196 } else {
197 expect(result.nextStepParams).toBeUndefined();
198 }
199 return;
200 }
201
202 expect(result.content).toEqual([]);
203 expect(result._meta).toEqual(
204 expect.objectContaining({
205 pendingXcodebuild: expect.objectContaining({
206 kind: 'pending-xcodebuild',
207 }),
208 }),
209 );
210
211 if (nextStepToolId) {
212 expect(result.nextStepParams).toEqual(
213 expect.objectContaining({
214 [nextStepToolId]: expect.any(Object),
215 }),
216 );
217 } else {
218 expect(result.nextStepParams).toBeUndefined();
219 }
220}

Callers 5

test_macos.test.tsFile · 0.90
build_sim.test.tsFile · 0.90

Calls 2

isMockToolHandlerResultFunction · 0.85
textMethod · 0.80

Tested by

no test coverage detected