(
response: { webSearches?: unknown },
fixtureIndex: number,
results: ValidationResult[],
)
| 237 | } |
| 238 | |
| 239 | function validateWebSearches( |
| 240 | response: { webSearches?: unknown }, |
| 241 | fixtureIndex: number, |
| 242 | results: ValidationResult[], |
| 243 | ): void { |
| 244 | if (response.webSearches !== undefined) { |
| 245 | if (!Array.isArray(response.webSearches)) { |
| 246 | results.push({ |
| 247 | severity: "error", |
| 248 | fixtureIndex, |
| 249 | message: "webSearches must be an array of strings", |
| 250 | }); |
| 251 | } else if (response.webSearches.length === 0) { |
| 252 | results.push({ |
| 253 | severity: "warning", |
| 254 | fixtureIndex, |
| 255 | message: "webSearches is empty array — no web search events will be emitted", |
| 256 | }); |
| 257 | } else { |
| 258 | for (let j = 0; j < response.webSearches.length; j++) { |
| 259 | if (typeof response.webSearches[j] !== "string") { |
| 260 | results.push({ |
| 261 | severity: "error", |
| 262 | fixtureIndex, |
| 263 | message: `webSearches[${j}] is not a string`, |
| 264 | }); |
| 265 | break; |
| 266 | } |
| 267 | if (response.webSearches[j] === "") { |
| 268 | results.push({ |
| 269 | severity: "warning", |
| 270 | fixtureIndex, |
| 271 | message: `webSearches[${j}] is empty string`, |
| 272 | }); |
| 273 | } |
| 274 | } |
| 275 | } |
| 276 | } |
| 277 | } |
| 278 | |
| 279 | function validateBlocks( |
| 280 | response: { blocks?: unknown; content?: unknown; toolCalls?: unknown }, |
no outgoing calls
no test coverage detected
searching dependent graphs…