Skip to content

Commit

Permalink
Add extensive hydration error test suite for Pages router
Browse files Browse the repository at this point in the history
Pages router will support both React 18 and 19 which has significant changes for hydration errors.
The existing acceptance tests only cover App router which runs exclusive on React 19.

Ideally this would be a single test suite that just forks on the assertion. However, there are a lot of differences between App router and Pages router and putting that into a single file takes more time.

The goal here is to not regress any further with Pages router when extending support to 18.
Once RC2 landed, I'll merge these test suites.
  • Loading branch information
eps1lon committed Sep 23, 2024
1 parent babae8d commit 55eeeef
Show file tree
Hide file tree
Showing 5 changed files with 814 additions and 42 deletions.
2 changes: 1 addition & 1 deletion test/development/acceptance-app/hydration-error.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { getRedboxTotalErrorCount } from 'next-test-utils'

// https://github.com/facebook/react/blob/main/packages/react-dom/src/__tests__/ReactDOMHydrationDiff-test.js used as a reference

describe('Error overlay for hydration errors', () => {
describe('Error overlay for hydration errors in App router', () => {
const { next, isTurbopack } = nextTestSetup({
files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')),
skipStart: true,
Expand Down
Loading

0 comments on commit 55eeeef

Please sign in to comment.