Skip to content

Commit

Permalink
test: wait for HMR connection
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Dec 12, 2024
1 parent 388403f commit b5406e9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion playground/vitestSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,10 @@ export async function startDefaultServe(): Promise<void> {
viteTestUrl = `http://localhost:${server.config.server.port}${
devBase === '/' ? '' : devBase
}`
await page.goto(viteTestUrl)
const hmrConnectionPromise = page.waitForEvent('console', {
predicate: (e) => e.text().includes('[vite] connected.'),
})
await Promise.all([page.goto(viteTestUrl), hmrConnectionPromise])
} else {
process.env.VITE_INLINE = 'inline-build'
// determine build watch
Expand Down

0 comments on commit b5406e9

Please sign in to comment.