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

server.test.ts

14 lines469 Bytes

1import { describe, expect, it } from 'vitest'
2import { renderToStaticMarkup } from 'octane/server'
3import { ServerChat } from '../_fixtures/server.tsrx'
4​
5describe('@tanstack/ai-octane SSR', () => {
6 it('renders the initial chat snapshot without a DOM', () => {
7 expect(typeof document).toBe('undefined')
8​
9 const { html, css } = renderToStaticMarkup(ServerChat)
10​
11 expect(html).toBe('<ul id="messages"><li>Hello Ada</li></ul>')
12 expect(css).toBe('')
13 })
14})