Open History to see the last commit
1import { test, expect } from './fixtures'
2
3test.describe('openrouter — retryCodes', () => {
4 // The fixture answers the first request with a 429 and only the second with
5 // content, so the text proves the SDK retried.
6 test('retries a 429 when retryCodes includes it', async ({
7 request,
8 testId,
9 }) => {
10 const response = await request.post(
11 `/api/openrouter-retry-codes?testId=${encodeURIComponent(testId)}`,
12 )
13 expect(response.ok()).toBe(true)
14 expect(await response.json()).toEqual({
15 text: 'Hello after retry',
16 error: null,
17 })
18 })
19})