(
page: import('@playwright/test').Page,
baseURL: string | undefined,
testId: string | undefined,
)
| 2 | import { test, expect } from './fixtures' |
| 3 | |
| 4 | async function fetchOtelCapture( |
| 5 | page: import('@playwright/test').Page, |
| 6 | baseURL: string | undefined, |
| 7 | testId: string | undefined, |
| 8 | ) { |
| 9 | if (!testId) throw new Error('otel capture test requires a testId fixture') |
| 10 | const url = `${baseURL ?? ''}/api/middleware-test?testId=${encodeURIComponent(testId)}` |
| 11 | const response = await page.request.get(url) |
| 12 | if (!response.ok()) { |
| 13 | throw new Error( |
| 14 | `GET ${url} failed: ${response.status()} ${await response.text()}`, |
| 15 | ) |
| 16 | } |
| 17 | return response.json() |
| 18 | } |
| 19 | |
| 20 | test.describe('Middleware Lifecycle', () => { |
| 21 | test('onChunk transforms text content', async ({ |
no test coverage detected