Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flaky full reload hmr tests #40786

Merged
merged 2 commits into from Sep 22, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 9 additions & 4 deletions test/development/basic/hmr.test.ts
Expand Up @@ -793,13 +793,14 @@ describe('basic HMR', () => {
)
const newFileContent = currentFileContent.replace(
'<p>hello world</p>',
'<p>hello world!!!</p>'
'<p id="updated">hello world!!!</p>'
)
await next.patchFile(
'./pages/hmr/anonymous-page-function.js',
newFileContent
)
await check(() => browser.elementByCss('p').text(), 'hello world!!!')

await browser.waitForElementByCss('#updated')

// CLI warning and stacktrace
expect(next.cliOutput.slice(start)).toContain(
Expand Down Expand Up @@ -834,9 +835,13 @@ describe('basic HMR', () => {
const currentFileContent = await next.readFile(
'./pages/hmr/runtime-error.js'
)
const newFileContent = currentFileContent.replace('whoops', '"whoops"')
const newFileContent = currentFileContent.replace(
'whoops',
'<p id="updated">whoops</p>'
)
await next.patchFile('./pages/hmr/runtime-error.js', newFileContent)
await check(() => browser.elementByCss('body').text(), 'whoops')

await browser.waitForElementByCss('#updated')
hanneslund marked this conversation as resolved.
Show resolved Hide resolved

// CLI warning and stacktrace
expect(next.cliOutput.slice(start)).toContain(
Expand Down