Files
hrmnyandGitHub aa90fe9bb7 fix(turbopack): correctly handle catchall specificity (#68800)
(generated by graphite)

### What?

Introduce `get_specificity` method to determine the specificity of
routes.
This facilitates more accurate route matching for catchall routes by
comparing route specificity.
Modify existing route matching logic to incorporate specificity checks
and avoid route conflicts.
Add corresponding tests to validate the new specificity handling
mechanism.

Fixes #67045
Closes PACK-3154
2024-08-20 18:07:28 +02:00

20 lines
556 B
TypeScript

import { nextTestSetup } from 'e2e-utils'
describe('catchall-specificity', () => {
const { next } = nextTestSetup({
files: __dirname,
})
it('should match the generic catchall correctly', async () => {
const browser = await next.browser('/foo')
expect(await browser.elementByCss('body').text()).toContain('Generic Page')
})
it('should match the specific catchall correctly', async () => {
const browser = await next.browser('/specific')
expect(await browser.elementByCss('body').text()).toContain('Specific Page')
})
})