* E2E coverage for the structured-output × middleware interaction * introduced in TanStack/ai#390. Two contracts under test: * * 1. Phase observation: the middleware chain sees chunks tagged with * `ctx.phase === 'structuredOutput'` and `onFinish` is invoked exactly * once. Guards a
( testId?: string, aimockPort?: number, provider?: string, model?: string, )
| 33 | */ |
| 34 | |
| 35 | function buildHarnessUrl( |
| 36 | testId?: string, |
| 37 | aimockPort?: number, |
| 38 | provider?: string, |
| 39 | model?: string, |
| 40 | ): string { |
| 41 | const params = new URLSearchParams() |
| 42 | if (testId) params.set('testId', testId) |
| 43 | if (aimockPort) params.set('aimockPort', String(aimockPort)) |
| 44 | if (provider) params.set('provider', provider) |
| 45 | if (model) params.set('model', model) |
| 46 | const qs = params.toString() |
| 47 | return `/middleware-test${qs ? '?' + qs : ''}` |
| 48 | } |
| 49 | |
| 50 | function parseStringArray(raw: string | null): Array<string> { |
| 51 | if (!raw) return [] |
no test coverage detected