Skip to content

Commit 62e7120

Browse files
committed
test: make rewrite test case conditional on next.js version being used
1 parent 2da94c5 commit 62e7120

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

tests/e2e/edge-middleware.test.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,17 @@ test.describe('json data', () => {
8484
selector: 'NextResponse.rewrite()#getStaticProps',
8585
jsonPathMatcher: '/link/rewrite-me-getstaticprops.json',
8686
},
87-
{
87+
]
88+
89+
// Linking to static pages reloads on rewrite for versions below 14
90+
if (nextVersionSatisfies('>=14.0.0')) {
91+
testConfigs.push({
8892
describeLabel: 'NextResponse.rewrite() -> fully static page',
8993
selector: 'NextResponse.rewrite()#fullyStatic',
9094
jsonPathMatcher: '/link/rewrite-me-fullystatic.json',
91-
},
92-
]
95+
})
96+
}
97+
9398
test.describe('no 18n', () => {
9499
for (const testConfig of testConfigs) {
95100
test.describe(testConfig.describeLabel, () => {

0 commit comments

Comments
 (0)