Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

non-streaming-run-error.spec.ts

14 lines439 Bytes

1import { test, expect } from './fixtures'
2​
3test('non-streaming chat rejects when the provider stream emits RUN_ERROR', async ({
4 request,
5}) => {
6 const response = await request.post('/api/non-streaming-run-error')
7​
8 expect(response.ok()).toBe(true)
9 await expect(response.json()).resolves.toMatchObject({
10 rejected: true,
11 message: expect.stringContaining('Synthetic upstream failure'),
12 code: 'rate_limit_exceeded',
13 })
14})