forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add test for turbopack refresh error (vercel#55447)
Closes WEB-1584
- Loading branch information
1 parent
b3a916c
commit e191ae3
Showing
4 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export default function Root({ children }) { | ||
return ( | ||
<html> | ||
<body>{children}</body> | ||
</html> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function Page() { | ||
return <p>Page</p> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { nextTestSetup } from 'e2e-utils' | ||
import { describeVariants as describe, waitFor } from 'next-test-utils' | ||
import { sandbox, waitForHydration } from 'development-sandbox' | ||
|
||
describe.each(['default', 'turbo'])('basic app-dir tests', () => { | ||
const { next } = nextTestSetup({ | ||
files: __dirname, | ||
}) | ||
|
||
it('should reload app pages without error', async () => { | ||
const { session, cleanup, browser } = await sandbox(next, undefined, '/') | ||
expect(await session.hasRedbox(false)).toBe(false) | ||
|
||
browser.refresh() | ||
|
||
await waitFor(750) | ||
await waitForHydration(browser) | ||
|
||
for (let i = 0; i < 15; i++) { | ||
expect(await session.hasRedbox(false)).toBe(false) | ||
await waitFor(1000) | ||
} | ||
|
||
await cleanup() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters