Skip to content

Commit

Permalink
test: fix flaky "should reload" test (#17961)
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Aug 28, 2024
1 parent cfb621e commit 8ce8683
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions playground/html/__tests__/html.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
isBuild,
isServe,
page,
untilBrowserLogAfter,
viteServer,
viteTestUrl,
withRetry,
Expand Down Expand Up @@ -298,8 +299,11 @@ describe.runIf(isServe)('invalid', () => {
})

test('should reload when fixed', async () => {
await page.goto(viteTestUrl + '/invalid.html')
await editFile('invalid.html', (content) => {
await untilBrowserLogAfter(
() => page.goto(viteTestUrl + '/invalid.html'),
/connected/, // wait for HMR connection
)
editFile('invalid.html', (content) => {
return content.replace('<div Bad', '<div> Good')
})
const content = await page.waitForSelector('text=Good HTML')
Expand Down

0 comments on commit 8ce8683

Please sign in to comment.