Skip to content

Commit da18c65

Browse files
authored
test(react): wait for hmr update to reduce flakyness (#459)
1 parent a758bfe commit da18c65

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Diff for: playground/react/__tests__/react.spec.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,12 @@ test.runIf(isServe)('should not invalidate when code is invalid', async () => {
4646
// if import.meta.invalidate happened, the old page won't be shown because the page is reloaded
4747
expect(await page.textContent('h1')).toMatch('Hello Vite + React')
4848

49-
editFile('App.jsx', (code) =>
50-
code.replace('<div className="App"}>', '<div className="App">'),
49+
await untilBrowserLogAfter(
50+
() =>
51+
editFile('App.jsx', (code) =>
52+
code.replace('<div className="App"}>', '<div className="App">'),
53+
),
54+
'[vite] hot updated: /App.jsx',
5155
)
5256
})
5357

0 commit comments

Comments
 (0)