next.js/test/e2e/app-dir/edge-route-catchall/edge-route-catchall.test.ts
edge-route-catchall.test.ts22 lines623 B
import { nextTestSetup } from 'e2e-utils'

describe('edge-route-catchall', () => {
  const { next } = nextTestSetup({
    files: __dirname,
  })

  it('should correctly normalize edge route catch-all with a single param', async () => {
    const result = await next.fetch('/edge/one')

    expect(await result.text()).toBe(JSON.stringify({ slug: ['one'] }))
  })

  it('should correctly normalize edge route catch-all with multiple params', async () => {
    const result = await next.fetch('/edge/one/two/three')

    expect(await result.text()).toBe(
      JSON.stringify({ slug: ['one', 'two', 'three'] })
    )
  })
})
Quest for Codev2.0.0
/
SIGN IN