Skip to content

Commit

Permalink
Fix flaky full reload hmr tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Hannes Bornö committed Sep 22, 2022
1 parent cc1e35d commit 7974385
Showing 1 changed file with 9 additions and 4 deletions.
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')

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

0 comments on commit 7974385

Please sign in to comment.