next.js/test/e2e/app-dir/interception-routes-output-export/interception-routes-output-export.test.ts
interception-routes-output-export.test.ts31 lines919 B
import { isNextDev, isNextStart } from 'e2e-utils'
import { findPort, killApp, launchApp, nextBuild, retry } from 'next-test-utils'

describe('interception-routes-output-export', () => {
  it('should error when using interception routes with static export', async () => {
    if (isNextStart) {
      const { code, stderr } = await nextBuild(__dirname, [], { stderr: true })
      expect(stderr).toContain(
        'Intercepting routes are not supported with static export.'
      )
      expect(code).toBe(1)
    } else if (isNextDev) {
      let stderr = ''
      const port = await findPort()
      const app = await launchApp(__dirname, port, {
        onStderr(msg) {
          stderr += msg || ''
        },
      })

      await retry(async () => {
        expect(stderr).toContain(
          'Intercepting routes are not supported with static export.'
        )
      })

      await killApp(app)
    }
  })
})
Quest for Codev2.0.0
/
SIGN IN