( result: ToolResponse | MockToolHandlerResult, nextStepToolId?: string, )
| 181 | } |
| 182 | |
| 183 | export 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 | } |
no test coverage detected