Skip to content

Commit 65eb48f

Browse files
authored
test: fix flaky test fail (#16667)
1 parent 76d1642 commit 65eb48f

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

playground/hmr/__tests__/hmr.spec.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -829,13 +829,17 @@ if (!isBuild) {
829829
'parent:not-child',
830830
)
831831

832-
addFile(childFile, originalChildFileCode)
833-
editFile(parentFile, (code) =>
834-
code.replace(
835-
"export const childValue = 'not-child'",
836-
"export { value as childValue } from './child'",
837-
),
838-
)
832+
await untilBrowserLogAfter(async () => {
833+
const loadPromise = page.waitForEvent('load')
834+
addFile(childFile, originalChildFileCode)
835+
editFile(parentFile, (code) =>
836+
code.replace(
837+
"export const childValue = 'not-child'",
838+
"export { value as childValue } from './child'",
839+
),
840+
)
841+
await loadPromise
842+
}, [/connected/])
839843
await untilUpdated(
840844
() => page.textContent('.file-delete-restore'),
841845
'parent:child',

0 commit comments

Comments
 (0)