mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
## What? Implements the missing part of the error to make the test pass. Small difference between webpack/Turbopack is that Turbopack will spot the conflict earlier and because of that errors earlier too, making the path still correct but shorter, not a problem in my opinion. --------- Co-authored-by: Niklas Mischkulnig <[email protected]>
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
import { nextTestSetup } from 'e2e-utils'
|
|
import { retry } from 'next-test-utils'
|
|
|
|
describe('conflicting-page-segments', () => {
|
|
const { next, isNextDev, skipped } = nextTestSetup({
|
|
files: __dirname,
|
|
// we skip start & deploy because the build will fail and we won't be able to catch it
|
|
// start is re-triggered but caught in the assertions below.
|
|
skipStart: true,
|
|
skipDeployment: true,
|
|
})
|
|
|
|
if (skipped) {
|
|
return
|
|
}
|
|
|
|
it('should throw an error when a route groups causes a conflict with a parallel segment', async () => {
|
|
if (isNextDev) {
|
|
await next.start()
|
|
const html = await next.render('/')
|
|
|
|
expect(html).toContain(
|
|
'You cannot have two parallel pages that resolve to the same path.'
|
|
)
|
|
} else {
|
|
await expect(next.start()).rejects.toThrow('next build failed')
|
|
|
|
await retry(() => {
|
|
expect(next.cliOutput).toMatch(
|
|
/You cannot have two parallel pages that resolve to the same path\. Please check \/\(group-a\)(\/page)? and \/\(group-b\)(\/page)?\./i
|
|
)
|
|
})
|
|
}
|
|
})
|
|
})
|