diff --git a/playground/vitestSetup.ts b/playground/vitestSetup.ts index 94a7142d..6097ebf1 100644 --- a/playground/vitestSetup.ts +++ b/playground/vitestSetup.ts @@ -252,7 +252,10 @@ export async function startDefaultServe(): Promise { 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