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

fake-text.spec.ts

14 lines370 Bytes

1import { test, expect } from './fixtures'
2​
3test('fakeText from @tanstack/ai/testing runs a tool loop with no network', async ({
4 request,
5}) => {
6 const response = await request.post('/api/fake-text')
7​
8 expect(response.ok()).toBe(true)
9 await expect(response.json()).resolves.toEqual({
10 text: 'Tool said: sunny in Oslo',
11 callCount: 2,
12 pending: 0,
13 })
14})