Skip to content

Commit e191ae3

Browse files
add test for turbopack refresh error (#55447)
Closes WEB-1584
1 parent b3a916c commit e191ae3

File tree

4 files changed

+37
-0
lines changed

4 files changed

+37
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default function Root({ children }) {
2+
return (
3+
<html>
4+
<body>{children}</body>
5+
</html>
6+
)
7+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default function Page() {
2+
return <p>Page</p>
3+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { nextTestSetup } from 'e2e-utils'
2+
import { describeVariants as describe, waitFor } from 'next-test-utils'
3+
import { sandbox, waitForHydration } from 'development-sandbox'
4+
5+
describe.each(['default', 'turbo'])('basic app-dir tests', () => {
6+
const { next } = nextTestSetup({
7+
files: __dirname,
8+
})
9+
10+
it('should reload app pages without error', async () => {
11+
const { session, cleanup, browser } = await sandbox(next, undefined, '/')
12+
expect(await session.hasRedbox(false)).toBe(false)
13+
14+
browser.refresh()
15+
16+
await waitFor(750)
17+
await waitForHydration(browser)
18+
19+
for (let i = 0; i < 15; i++) {
20+
expect(await session.hasRedbox(false)).toBe(false)
21+
await waitFor(1000)
22+
}
23+
24+
await cleanup()
25+
})
26+
})

test/turbopack-tests-manifest.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const enabledTests = [
55
'test/development/acceptance-app/server-components.test.ts',
66
'test/development/acceptance/hydration-error.test.ts',
77
'test/development/api-cors-with-rewrite/index.test.ts',
8+
'test/development/app-dir/basic/basic.test.ts',
89
'test/development/app-dir/multiple-compiles-single-route/multiple-compiles-single-route.test.ts',
910
'test/development/app-dir/strict-mode-enabled-by-default/strict-mode-enabled-by-default.test.ts',
1011
'test/development/basic/define-class-fields.test.ts',

0 commit comments

Comments
 (0)