mirror of
https://github.com/hanzoai/vite.git
synced 2026-10-30 19:36:16 +00:00
17 lines
476 B
TypeScript
17 lines
476 B
TypeScript
import { expect, test } from 'vitest'
|
|
import { port } from './serve'
|
|
import { isBuild, page } from '~utils'
|
|
|
|
const url = `http://localhost:${port}/`
|
|
|
|
test.runIf(!isBuild)('optimize', async () => {
|
|
await page.goto(url)
|
|
// reload page to get optimized missing deps
|
|
await page.reload()
|
|
await expect.poll(() => page.textContent('div')).toMatch('Client')
|
|
|
|
// raw http request
|
|
const aboutHtml = await (await fetch(url)).text()
|
|
expect(aboutHtml).toContain('Server')
|
|
})
|