Skip to content

Commit

Permalink
test: fix flaky tests (vitejs#10222)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy committed Sep 23, 2022
1 parent ea09fde commit 097fd57
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions playground/ssr-vue/__tests__/ssr-vue.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,18 @@ test('hydration', async () => {
expect(await page.textContent('button')).toMatch('1')
})

test('hmr', async () => {
// This is test is flaky in Mac CI, but can't be reproduced locally. Wait until
// network idle to avoid the issue. TODO: This may be caused by a bug when
// modifying a file while loading, we should remove this guard
await page.goto(url, { waitUntil: 'networkidle' })
editFile('src/pages/Home.vue', (code) => code.replace('Home', 'changed'))
await untilUpdated(() => page.textContent('h1'), 'changed')
})
test(
'hmr',
async () => {
// This is test is flaky in Mac CI, but can't be reproduced locally. Wait until
// network idle to avoid the issue. TODO: This may be caused by a bug when
// modifying a file while loading, we should remove this guard
await page.goto(url, { waitUntil: 'networkidle' })
editFile('src/pages/Home.vue', (code) => code.replace('Home', 'changed'))
await untilUpdated(() => page.textContent('h1'), 'changed')
},
{ retry: 3 }
)

test('client navigation', async () => {
await page.goto(url)
Expand Down

0 comments on commit 097fd57

Please sign in to comment.