Skip to content

Commit

Permalink
Ensure the flakiness highlighted in the new test does not leak to oth…
Browse files Browse the repository at this point in the history
…er tests
  • Loading branch information
eps1lon committed Jul 15, 2024
1 parent 7809d8f commit c2d6b5a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/development/app-hmr/hmr.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ describe(`app-dir-hmr`, () => {
})

it('should update server components pages when env files is changed (nodejs)', async () => {
// If "should update server components after navigating to a page with a different runtime" failed, the dev server is in a corrupted state.
// Restart fixes this.
await next.stop()
await next.start()

const envContent = await next.readFile(envFile)
const browser = await next.browser('/env/node')
expect(await browser.elementByCss('p').text()).toBe('mac')
Expand Down Expand Up @@ -167,6 +172,10 @@ describe(`app-dir-hmr`, () => {
})

it('should update server components pages when env files is changed (edge)', async () => {
// Restart to work around a bug highlighted in the flakiness of "should update server components after navigating to a page with a different runtime"
await next.stop()
await next.start()

const envContent = await next.readFile(envFile)
const browser = await next.browser('/env/edge')
expect(await browser.elementByCss('p').text()).toBe('mac')
Expand Down

0 comments on commit c2d6b5a

Please sign in to comment.