Unverified Commit a961ec0d authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Skip production tests for Turbopack (#56045)

As Turbopack is only focusing on dev currently. 

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->
parent 379f2d82
...@@ -152,19 +152,19 @@ jobs: ...@@ -152,19 +152,19 @@ jobs:
secrets: inherit secrets: inherit
# --type production also runs tests/e2e # --type production also runs tests/e2e
test-turbopack-prod: # test-turbopack-prod:
name: test turbopack prod # name: test turbopack prod
needs: ['build-native', 'build-next'] # needs: ['build-native', 'build-next']
strategy: # strategy:
fail-fast: false # fail-fast: false
matrix: # matrix:
group: [1, 2, 3, 4, 5] # group: [1, 2, 3, 4, 5]
uses: ./.github/workflows/build_reusable.yml # uses: ./.github/workflows/build_reusable.yml
with: # with:
nodeVersion: 16 # nodeVersion: 16
skipForDocsOnly: 'yes' # skipForDocsOnly: 'yes'
afterBuild: RUST_BACKTRACE=0 NEXT_EXTERNAL_TESTS_FILTERS="$(pwd)/test/turbopack-tests-manifest.json" TURBOPACK=1 NEXT_TEST_MODE=start node run-tests.js --timings -g ${{ matrix.group }}/5 -c ${TEST_CONCURRENCY} --type production # afterBuild: RUST_BACKTRACE=0 NEXT_EXTERNAL_TESTS_FILTERS="$(pwd)/test/turbopack-tests-manifest.json" TURBOPACK=1 NEXT_TEST_MODE=start node run-tests.js --timings -g ${{ matrix.group }}/5 -c ${TEST_CONCURRENCY} --type production
secrets: inherit # secrets: inherit
test-next-swc-wasm: test-next-swc-wasm:
name: test next-swc wasm name: test next-swc wasm
......
...@@ -21,7 +21,7 @@ let appPort ...@@ -21,7 +21,7 @@ let appPort
let app let app
describe('404 Page Support with _app', () => { describe('404 Page Support with _app', () => {
describe('production mode', () => { ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
it('should build successfully', async () => { it('should build successfully', async () => {
......
...@@ -25,7 +25,7 @@ let app ...@@ -25,7 +25,7 @@ let app
const context = {} const context = {}
describe('AMP Usage', () => { describe('AMP Usage', () => {
describe('production mode', () => { ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
let output = '' let output = ''
beforeAll(async () => { beforeAll(async () => {
......
...@@ -56,8 +56,7 @@ describe('AppTree', () => { ...@@ -56,8 +56,7 @@ describe('AppTree', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests() runTests()
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
appPort = await findPort() appPort = await findPort()
......
...@@ -7,7 +7,7 @@ import { nextBuild } from 'next-test-utils' ...@@ -7,7 +7,7 @@ import { nextBuild } from 'next-test-utils'
const appDir = __dirname const appDir = __dirname
describe('app type checking', () => { describe('app type checking', () => {
describe('production mode', () => { ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
let stderr, errors let stderr, errors
beforeAll(async () => { beforeAll(async () => {
stderr = (await nextBuild(appDir, [], { stderr: true })).stderr stderr = (await nextBuild(appDir, [], { stderr: true })).stderr
......
...@@ -115,8 +115,7 @@ describe('Async modules', () => { ...@@ -115,8 +115,7 @@ describe('Async modules', () => {
runTests(true) runTests(true)
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
appPort = await findPort() appPort = await findPort()
......
...@@ -37,8 +37,7 @@ describe('dev mode', () => { ...@@ -37,8 +37,7 @@ describe('dev mode', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests() runTests()
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
buildId = await fs.readFile(join(appDir, '.next/BUILD_ID'), 'utf8') buildId = await fs.readFile(join(appDir, '.next/BUILD_ID'), 'utf8')
......
...@@ -35,8 +35,7 @@ describe('Client 404', () => { ...@@ -35,8 +35,7 @@ describe('Client 404', () => {
runTests() runTests()
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
context.appPort = await findPort() context.appPort = await findPort()
......
...@@ -97,8 +97,7 @@ describe('Client Shallow Routing', () => { ...@@ -97,8 +97,7 @@ describe('Client Shallow Routing', () => {
runTests() runTests()
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
appPort = await findPort() appPort = await findPort()
......
...@@ -93,8 +93,7 @@ describe('Basic CSS Modules Ordering', () => { ...@@ -93,8 +93,7 @@ describe('Basic CSS Modules Ordering', () => {
tests() tests()
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('Production Mode', () => {
beforeAll(async () => { beforeAll(async () => {
await remove(join(appDir, '.next')) await remove(join(appDir, '.next'))
}) })
...@@ -436,8 +435,7 @@ describe('CSS Modules Composes Ordering', () => { ...@@ -436,8 +435,7 @@ describe('CSS Modules Composes Ordering', () => {
tests(true) tests(true)
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('Production Mode', () => {
beforeAll(async () => { beforeAll(async () => {
await remove(join(appDir, '.next')) await remove(join(appDir, '.next'))
}) })
......
...@@ -168,21 +168,24 @@ describe('CSS Support', () => { ...@@ -168,21 +168,24 @@ describe('CSS Support', () => {
}) })
} }
describe('Production Mode', () => { ;(process.env.TURBOPACK ? describe.skip : describe)(
beforeAll(async () => { 'production mode',
await remove(join(appDir, '.next')) () => {
}) beforeAll(async () => {
beforeAll(async () => { await remove(join(appDir, '.next'))
await nextBuild(appDir, [], {}) })
appPort = await findPort() beforeAll(async () => {
app = await nextStart(appDir, appPort) await nextBuild(appDir, [], {})
}) appPort = await findPort()
afterAll(async () => { app = await nextStart(appDir, appPort)
await killApp(app) })
}) afterAll(async () => {
await killApp(app)
tests() })
})
tests()
}
)
}) })
describe('CSS Cleanup on Render Failure', () => { describe('CSS Cleanup on Render Failure', () => {
...@@ -231,21 +234,24 @@ describe('CSS Support', () => { ...@@ -231,21 +234,24 @@ describe('CSS Support', () => {
}) })
} }
describe('Production Mode', () => { ;(process.env.TURBOPACK ? describe.skip : describe)(
beforeAll(async () => { 'production mode',
await remove(join(appDir, '.next')) () => {
}) beforeAll(async () => {
beforeAll(async () => { await remove(join(appDir, '.next'))
await nextBuild(appDir, [], {}) })
appPort = await findPort() beforeAll(async () => {
app = await nextStart(appDir, appPort) await nextBuild(appDir, [], {})
}) appPort = await findPort()
afterAll(async () => { app = await nextStart(appDir, appPort)
await killApp(app) })
}) afterAll(async () => {
await killApp(app)
tests() })
})
tests()
}
)
}) })
describe('Page reload on CSS missing', () => { describe('Page reload on CSS missing', () => {
...@@ -280,31 +286,34 @@ describe('CSS Support', () => { ...@@ -280,31 +286,34 @@ describe('CSS Support', () => {
}) })
} }
describe('Production Mode', () => { ;(process.env.TURBOPACK ? describe.skip : describe)(
beforeAll(async () => { 'production mode',
await remove(join(appDir, '.next')) () => {
}) beforeAll(async () => {
beforeAll(async () => { await remove(join(appDir, '.next'))
await nextBuild(appDir, [], {}) })
appPort = await findPort() beforeAll(async () => {
app = await nextStart(appDir, appPort) await nextBuild(appDir, [], {})
appPort = await findPort()
// Remove other page CSS files: app = await nextStart(appDir, appPort)
const manifest = await readJSON(
join(appDir, '.next', 'build-manifest.json') // Remove other page CSS files:
) const manifest = await readJSON(
const files = manifest['pages']['/other'].filter((e) => join(appDir, '.next', 'build-manifest.json')
e.endsWith('.css') )
) const files = manifest['pages']['/other'].filter((e) =>
if (files.length < 1) throw new Error() e.endsWith('.css')
await Promise.all(files.map((f) => remove(join(appDir, '.next', f)))) )
}) if (files.length < 1) throw new Error()
afterAll(async () => { await Promise.all(files.map((f) => remove(join(appDir, '.next', f))))
await killApp(app) })
}) afterAll(async () => {
await killApp(app)
tests() })
})
tests()
}
)
}) })
describe('Page hydrates with CSS and not waiting on dependencies', () => { describe('Page hydrates with CSS and not waiting on dependencies', () => {
...@@ -373,34 +382,37 @@ describe('CSS Support', () => { ...@@ -373,34 +382,37 @@ describe('CSS Support', () => {
}) })
} }
describe('Production Mode', () => { ;(process.env.TURBOPACK ? describe.skip : describe)(
beforeAll(async () => { 'production mode',
await remove(join(appDir, '.next')) () => {
}) beforeAll(async () => {
beforeAll(async () => { await remove(join(appDir, '.next'))
await nextBuild(appDir, [], {}) })
appPort = await findPort() beforeAll(async () => {
app = await nextStart(appDir, appPort) await nextBuild(appDir, [], {})
appPort = await findPort()
const buildId = ( app = await nextStart(appDir, appPort)
await readFile(join(appDir, '.next', 'BUILD_ID'), 'utf8')
).trim() const buildId = (
const fileName = join( await readFile(join(appDir, '.next', 'BUILD_ID'), 'utf8')
appDir, ).trim()
'.next/static/', const fileName = join(
buildId, appDir,
'_buildManifest.js' '.next/static/',
) buildId,
if (!(await pathExists(fileName))) { '_buildManifest.js'
throw new Error('Missing build manifest') )
} if (!(await pathExists(fileName))) {
await remove(fileName) throw new Error('Missing build manifest')
}) }
afterAll(async () => { await remove(fileName)
await killApp(app) })
}) afterAll(async () => {
await killApp(app)
tests() })
})
tests()
}
)
}) })
}) })
...@@ -79,8 +79,7 @@ describe('Custom _error', () => { ...@@ -79,8 +79,7 @@ describe('Custom _error', () => {
expect(html).toContain('An error 404 occurred on server') expect(html).toContain('An error 404 occurred on server')
}) })
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
let buildOutput = '' let buildOutput = ''
beforeAll(async () => { beforeAll(async () => {
......
...@@ -35,8 +35,7 @@ describe('Custom page extension', () => { ...@@ -35,8 +35,7 @@ describe('Custom page extension', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests() runTests()
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
appPort = await findPort() appPort = await findPort()
......
...@@ -53,8 +53,7 @@ describe('Custom routes', () => { ...@@ -53,8 +53,7 @@ describe('Custom routes', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests(true) runTests(true)
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
appPort = await findPort() appPort = await findPort()
......
...@@ -69,8 +69,7 @@ describe('Custom routes i18n with index redirect', () => { ...@@ -69,8 +69,7 @@ describe('Custom routes i18n with index redirect', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests(true) runTests(true)
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
appPort = await findPort() appPort = await findPort()
......
...@@ -176,8 +176,7 @@ describe('Custom routes i18n', () => { ...@@ -176,8 +176,7 @@ describe('Custom routes i18n', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests(true) runTests(true)
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
appPort = await findPort() appPort = await findPort()
......
...@@ -2970,9 +2970,11 @@ describe('Custom routes', () => { ...@@ -2970,9 +2970,11 @@ describe('Custom routes', () => {
describe('dev mode', () => { describe('dev mode', () => {
runSoloTests(true) runSoloTests(true)
}) })
;(process.env.TURBOPACK ? describe.skip : describe)(
describe('production mode', () => { 'production mode',
runSoloTests() () => {
}) runSoloTests()
}
)
}) })
}) })
...@@ -18,7 +18,7 @@ let app ...@@ -18,7 +18,7 @@ let app
const context = {} const context = {}
describe('disabled runtime JS', () => { describe('disabled runtime JS', () => {
describe('production mode', () => { ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
......
...@@ -10,7 +10,7 @@ let appPort ...@@ -10,7 +10,7 @@ let appPort
let app let app
describe('File Dependencies', () => { describe('File Dependencies', () => {
describe('production mode', () => { ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
await nextBuild(appDir) await nextBuild(appDir)
......
...@@ -62,8 +62,7 @@ describe('Dynamic Optional Routing Root Fallback', () => { ...@@ -62,8 +62,7 @@ describe('Dynamic Optional Routing Root Fallback', () => {
runTests() runTests()
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await fs.remove(join(appDir, '.next')) await fs.remove(join(appDir, '.next'))
......
...@@ -48,8 +48,7 @@ describe('Dynamic Optional Routing', () => { ...@@ -48,8 +48,7 @@ describe('Dynamic Optional Routing', () => {
runTests() runTests()
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
const curConfig = await fs.readFile(nextConfig, 'utf8') const curConfig = await fs.readFile(nextConfig, 'utf8')
......
...@@ -255,8 +255,7 @@ describe('Dynamic Optional Routing', () => { ...@@ -255,8 +255,7 @@ describe('Dynamic Optional Routing', () => {
}) })
}) })
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
const curConfig = await fs.readFile(nextConfig, 'utf8') const curConfig = await fs.readFile(nextConfig, 'utf8')
......
...@@ -1569,8 +1569,7 @@ describe('Dynamic Routing', () => { ...@@ -1569,8 +1569,7 @@ describe('Dynamic Routing', () => {
runTests({ dev: true }) runTests({ dev: true })
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await fs.remove(nextConfig) await fs.remove(nextConfig)
......
...@@ -158,23 +158,29 @@ describe.each([ ...@@ -158,23 +158,29 @@ describe.each([
expect(output).not.toContain('DynamicWasmCodeGenerationWarning') expect(output).not.toContain('DynamicWasmCodeGenerationWarning')
}) })
}) })
;(process.env.TURBOPACK ? describe.skip : describe)(
describe('production mode', () => { 'production mode',
let buildResult () => {
let buildResult
beforeAll(async () => {
buildResult = await nextBuild(context.appDir, undefined, { beforeAll(async () => {
stderr: true, buildResult = await nextBuild(context.appDir, undefined, {
stdout: true, stderr: true,
stdout: true,
})
}) })
})
it('should have middleware warning during build', () => { it('should have middleware warning during build', () => {
expect(buildResult.stderr).toContain(`Failed to compile`) expect(buildResult.stderr).toContain(`Failed to compile`)
expect(buildResult.stderr).toContain(`Used by usingEval, usingEvalSync`) expect(buildResult.stderr).toContain(
expect(buildResult.stderr).toContain(`Used by usingWebAssemblyCompile`) `Used by usingEval, usingEvalSync`
expect(buildResult.stderr).toContain(DYNAMIC_CODE_ERROR) )
}) expect(buildResult.stderr).toContain(
}) `Used by usingWebAssemblyCompile`
)
expect(buildResult.stderr).toContain(DYNAMIC_CODE_ERROR)
})
}
)
} }
) )
...@@ -65,8 +65,7 @@ describe('dev mode', () => { ...@@ -65,8 +65,7 @@ describe('dev mode', () => {
it('logs the error correctly', test(context)) it('logs the error correctly', test(context))
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
const context = createContext() const context = createContext()
beforeAll(async () => { beforeAll(async () => {
......
...@@ -110,8 +110,7 @@ Learn more: https://nextjs.org/docs/api-reference/edge-runtime`) ...@@ -110,8 +110,7 @@ Learn more: https://nextjs.org/docs/api-reference/edge-runtime`)
expect(stripAnsi(output)).toInclude(errorHighlight) expect(stripAnsi(output)).toInclude(errorHighlight)
}) })
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
let buildResult let buildResult
beforeAll(async () => { beforeAll(async () => {
......
...@@ -117,8 +117,7 @@ describe('fallback: false rewrite', () => { ...@@ -117,8 +117,7 @@ describe('fallback: false rewrite', () => {
runTests() runTests()
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await fs.remove(join(appDir, '.next')) await fs.remove(join(appDir, '.next'))
await nextBuild(appDir, []) await nextBuild(appDir, [])
......
...@@ -50,8 +50,7 @@ describe('Fallback Dynamic Route Params', () => { ...@@ -50,8 +50,7 @@ describe('Fallback Dynamic Route Params', () => {
runTests() runTests()
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await fs.remove(join(appDir, '.next')) await fs.remove(join(appDir, '.next'))
await nextBuild(appDir, []) await nextBuild(appDir, [])
......
...@@ -4482,8 +4482,7 @@ describe('File Serving', () => { ...@@ -4482,8 +4482,7 @@ describe('File Serving', () => {
runTests(true) runTests(true)
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
const { code } = await nextBuild(appDir) const { code } = await nextBuild(appDir)
......
...@@ -49,8 +49,7 @@ describe('getInitialProps', () => { ...@@ -49,8 +49,7 @@ describe('getInitialProps', () => {
runTests() runTests()
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
appPort = await findPort() appPort = await findPort()
......
...@@ -29,7 +29,7 @@ const runTests = () => { ...@@ -29,7 +29,7 @@ const runTests = () => {
} }
describe('getServerSideProps', () => { describe('getServerSideProps', () => {
describe('production mode', () => { ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await fs.remove(nextConfig) await fs.remove(nextConfig)
await fs.remove(join(appDir, '.next')) await fs.remove(join(appDir, '.next'))
......
...@@ -90,8 +90,7 @@ describe('gip identifiers', () => { ...@@ -90,8 +90,7 @@ describe('gip identifiers', () => {
describe('dev mode', () => { describe('dev mode', () => {
runTests(true) runTests(true)
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
runTests() runTests()
}) })
}) })
...@@ -40,8 +40,7 @@ describe('pageProps GSSP conflict', () => { ...@@ -40,8 +40,7 @@ describe('pageProps GSSP conflict', () => {
runTests() runTests()
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
const { code } = await nextBuild(appDir) const { code } = await nextBuild(appDir)
if (code !== 0) throw new Error(`build failed with code ${code}`) if (code !== 0) throw new Error(`build failed with code ${code}`)
......
...@@ -489,8 +489,7 @@ describe('GS(S)P Redirect Support', () => { ...@@ -489,8 +489,7 @@ describe('GS(S)P Redirect Support', () => {
runTests(true) runTests(true)
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await fs.remove(join(appDir, '.next')) await fs.remove(join(appDir, '.next'))
await nextBuild(appDir) await nextBuild(appDir)
......
...@@ -514,8 +514,7 @@ describe('GS(S)P Redirect Support', () => { ...@@ -514,8 +514,7 @@ describe('GS(S)P Redirect Support', () => {
runTests(true) runTests(true)
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
let output = '' let output = ''
beforeAll(async () => { beforeAll(async () => {
......
...@@ -46,8 +46,7 @@ describe('Hashbang', () => { ...@@ -46,8 +46,7 @@ describe('Hashbang', () => {
runTests(true) runTests(true)
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await fs.remove(nextConfig) await fs.remove(nextConfig)
await nextBuild(appDir) await nextBuild(appDir)
......
...@@ -50,8 +50,7 @@ describe('Hydration', () => { ...@@ -50,8 +50,7 @@ describe('Hydration', () => {
runTests() runTests()
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await fs.remove(path.join(appDir, '.next')) await fs.remove(path.join(appDir, '.next'))
await nextBuild(appDir) await nextBuild(appDir)
......
...@@ -59,8 +59,7 @@ describe('i18n Support basePath', () => { ...@@ -59,8 +59,7 @@ describe('i18n Support basePath', () => {
runTests(curCtx) runTests(curCtx)
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
nextConfig.replace(/__EXTERNAL_PORT__/g, ctx.externalPort) nextConfig.replace(/__EXTERNAL_PORT__/g, ctx.externalPort)
await fs.remove(join(appDir, '.next')) await fs.remove(join(appDir, '.next'))
......
...@@ -231,8 +231,7 @@ describe('i18n Support Root Catch-all', () => { ...@@ -231,8 +231,7 @@ describe('i18n Support Root Catch-all', () => {
runTests(true) runTests(true)
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await fs.remove(join(appDir, '.next')) await fs.remove(join(appDir, '.next'))
await nextBuild(appDir) await nextBuild(appDir)
......
...@@ -116,8 +116,7 @@ describe('Custom routes i18n', () => { ...@@ -116,8 +116,7 @@ describe('Custom routes i18n', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests(true) runTests(true)
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
appPort = await findPort() appPort = await findPort()
......
...@@ -98,8 +98,7 @@ describe('i18n Support', () => { ...@@ -98,8 +98,7 @@ describe('i18n Support', () => {
runTests() runTests()
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await fs.remove(join(appDir, '.next')) await fs.remove(join(appDir, '.next'))
await nextBuild(appDir) await nextBuild(appDir)
......
...@@ -98,8 +98,7 @@ describe('i18n Support', () => { ...@@ -98,8 +98,7 @@ describe('i18n Support', () => {
runTests() runTests()
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await fs.remove(join(appDir, '.next')) await fs.remove(join(appDir, '.next'))
await nextBuild(appDir) await nextBuild(appDir)
......
...@@ -84,8 +84,7 @@ describe('Custom routes i18n', () => { ...@@ -84,8 +84,7 @@ describe('Custom routes i18n', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests(true) runTests(true)
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
appPort = await findPort() appPort = await findPort()
......
...@@ -79,8 +79,7 @@ describe('Hash changes i18n', () => { ...@@ -79,8 +79,7 @@ describe('Hash changes i18n', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests(true) runTests(true)
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
appPort = await findPort() appPort = await findPort()
......
...@@ -58,8 +58,7 @@ describe('i18n Support', () => { ...@@ -58,8 +58,7 @@ describe('i18n Support', () => {
runTests(curCtx) runTests(curCtx)
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await fs.remove(join(appDir, '.next')) await fs.remove(join(appDir, '.next'))
nextConfig.replace(/__EXTERNAL_PORT__/g, ctx.externalPort) nextConfig.replace(/__EXTERNAL_PORT__/g, ctx.externalPort)
...@@ -433,26 +432,28 @@ describe('i18n Support', () => { ...@@ -433,26 +432,28 @@ describe('i18n Support', () => {
runSlashTests(curCtx) runSlashTests(curCtx)
}) })
;(process.env.TURBOPACK ? describe.skip : describe)(
'production mode',
() => {
const curCtx = {
...ctx,
}
beforeAll(async () => {
await fs.remove(join(appDir, '.next'))
nextConfig.replace('// trailingSlash', 'trailingSlash')
describe('production mode', () => { await nextBuild(appDir)
const curCtx = { curCtx.appPort = await findPort()
...ctx, curCtx.app = await nextStart(appDir, curCtx.appPort)
} })
beforeAll(async () => { afterAll(async () => {
await fs.remove(join(appDir, '.next')) nextConfig.restore()
nextConfig.replace('// trailingSlash', 'trailingSlash') await killApp(curCtx.app)
})
await nextBuild(appDir)
curCtx.appPort = await findPort()
curCtx.app = await nextStart(appDir, curCtx.appPort)
})
afterAll(async () => {
nextConfig.restore()
await killApp(curCtx.app)
})
runSlashTests(curCtx) runSlashTests(curCtx)
}) }
)
}) })
describe('with trailingSlash: false', () => { describe('with trailingSlash: false', () => {
...@@ -498,24 +499,26 @@ describe('i18n Support', () => { ...@@ -498,24 +499,26 @@ describe('i18n Support', () => {
runSlashTests(curCtx) runSlashTests(curCtx)
}) })
;(process.env.TURBOPACK ? describe.skip : describe)(
'production mode',
() => {
const curCtx = { ...ctx }
beforeAll(async () => {
await fs.remove(join(appDir, '.next'))
nextConfig.replace('// trailingSlash: true', 'trailingSlash: false')
await nextBuild(appDir)
curCtx.appPort = await findPort()
curCtx.app = await nextStart(appDir, curCtx.appPort)
})
afterAll(async () => {
nextConfig.restore()
await killApp(curCtx.app)
})
describe('production mode', () => { runSlashTests(curCtx)
const curCtx = { ...ctx } }
beforeAll(async () => { )
await fs.remove(join(appDir, '.next'))
nextConfig.replace('// trailingSlash: true', 'trailingSlash: false')
await nextBuild(appDir)
curCtx.appPort = await findPort()
curCtx.app = await nextStart(appDir, curCtx.appPort)
})
afterAll(async () => {
nextConfig.restore()
await killApp(curCtx.app)
})
runSlashTests(curCtx)
})
}) })
it('should show proper error for duplicate defaultLocales', async () => { it('should show proper error for duplicate defaultLocales', async () => {
......
...@@ -191,8 +191,7 @@ describe('nested index.js', () => { ...@@ -191,8 +191,7 @@ describe('nested index.js', () => {
runTests() runTests()
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
const curConfig = await fs.readFile(nextConfig, 'utf8') const curConfig = await fs.readFile(nextConfig, 'utf8')
......
...@@ -22,7 +22,7 @@ const runTest = () => { ...@@ -22,7 +22,7 @@ const runTest = () => {
} }
describe('Initial Refs', () => { describe('Initial Refs', () => {
describe('production mode', () => { ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
appPort = await findPort() appPort = await findPort()
......
...@@ -598,8 +598,7 @@ describe('Errors on invalid custom routes', () => { ...@@ -598,8 +598,7 @@ describe('Errors on invalid custom routes', () => {
runTests() runTests()
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(() => { beforeAll(() => {
getStderr = async () => { getStderr = async () => {
const { stderr } = await nextBuild(appDir, [], { stderr: true }) const { stderr } = await nextBuild(appDir, [], { stderr: true })
......
...@@ -84,7 +84,7 @@ const noError = async (pathname, click = false) => { ...@@ -84,7 +84,7 @@ const noError = async (pathname, click = false) => {
} }
describe('Invalid hrefs', () => { describe('Invalid hrefs', () => {
describe('production mode', () => { ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
appPort = await findPort() appPort = await findPort()
......
...@@ -153,8 +153,7 @@ describe('Errors on invalid custom middleware matchers', () => { ...@@ -153,8 +153,7 @@ describe('Errors on invalid custom middleware matchers', () => {
runTests() runTests()
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(() => { beforeAll(() => {
getStderr = async () => { getStderr = async () => {
const { stderr } = await nextBuild(appDir, [], { stderr: true }) const { stderr } = await nextBuild(appDir, [], { stderr: true })
......
...@@ -40,8 +40,7 @@ describe('Custom routes invalid multi-match', () => { ...@@ -40,8 +40,7 @@ describe('Custom routes invalid multi-match', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests(true) runTests(true)
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
appPort = await findPort() appPort = await findPort()
......
...@@ -83,8 +83,7 @@ describe('Invalid hrefs', () => { ...@@ -83,8 +83,7 @@ describe('Invalid hrefs', () => {
await noError('/child-ref-func') await noError('/child-ref-func')
}) })
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
appPort = await findPort() appPort = await findPort()
......
...@@ -36,8 +36,7 @@ describe('Link without a router', () => { ...@@ -36,8 +36,7 @@ describe('Link without a router', () => {
expect(container.textContent).toBe('Click me') expect(container.textContent).toBe('Click me')
}) })
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
it('should not throw when rendered', () => { it('should not throw when rendered', () => {
jest.useFakeTimers() jest.useFakeTimers()
......
...@@ -99,8 +99,7 @@ describe.each([ ...@@ -99,8 +99,7 @@ describe.each([
runTest() runTest()
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
let exportOutput = '' let exportOutput = ''
beforeAll(async () => { beforeAll(async () => {
......
...@@ -40,8 +40,7 @@ describe('next/dynamic', () => { ...@@ -40,8 +40,7 @@ describe('next/dynamic', () => {
runTests(true) runTests(true)
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
appPort = await findPort() appPort = await findPort()
......
...@@ -56,8 +56,7 @@ describe('next/dynamic', () => { ...@@ -56,8 +56,7 @@ describe('next/dynamic', () => {
runTests(true) runTests(true)
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await runNextCommand(['build', appDir]) await runNextCommand(['build', appDir])
......
...@@ -52,8 +52,7 @@ describe('next/dynamic', () => { ...@@ -52,8 +52,7 @@ describe('next/dynamic', () => {
runTests(true) runTests(true)
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await runNextCommand(['build', appDir]) await runNextCommand(['build', appDir])
......
...@@ -106,7 +106,7 @@ describe('Build Error Tests for basePath', () => { ...@@ -106,7 +106,7 @@ describe('Build Error Tests for basePath', () => {
}) })
}) })
describe('Static Image Component Tests for basePath', () => { describe('Static Image Component Tests for basePath', () => {
describe('production mode', () => { ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
appPort = await findPort() appPort = await findPort()
......
...@@ -205,7 +205,7 @@ describe('Build Error Tests', () => { ...@@ -205,7 +205,7 @@ describe('Build Error Tests', () => {
}) })
}) })
describe('Static Image Component Tests', () => { describe('Static Image Component Tests', () => {
describe('production mode', () => { ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
appPort = await findPort() appPort = await findPort()
......
...@@ -163,7 +163,7 @@ describe('Build Error Tests', () => { ...@@ -163,7 +163,7 @@ describe('Build Error Tests', () => {
}) })
}) })
describe('Static Image Component Tests for basePath', () => { describe('Static Image Component Tests for basePath', () => {
describe('production mode', () => { ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
appPort = await findPort() appPort = await findPort()
......
...@@ -217,7 +217,7 @@ describe('Build Error Tests', () => { ...@@ -217,7 +217,7 @@ describe('Build Error Tests', () => {
}) })
}) })
describe('Static Image Component Tests', () => { describe('Static Image Component Tests', () => {
describe('production mode', () => { ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
appPort = await findPort() appPort = await findPort()
......
...@@ -89,8 +89,7 @@ describe('Error no pageProps', () => { ...@@ -89,8 +89,7 @@ describe('Error no pageProps', () => {
runTests() runTests()
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
appPort = await findPort() appPort = await findPort()
......
...@@ -194,7 +194,7 @@ const runTests = () => { ...@@ -194,7 +194,7 @@ const runTests = () => {
} }
describe('SSG notFound revalidate', () => { describe('SSG notFound revalidate', () => {
describe('production mode', () => { ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await fs.remove(join(appDir, '.next')) await fs.remove(join(appDir, '.next'))
await nextBuild(appDir, undefined, { await nextBuild(appDir, undefined, {
......
...@@ -79,8 +79,7 @@ describe('Nullish configs in next.config.js', () => { ...@@ -79,8 +79,7 @@ describe('Nullish configs in next.config.js', () => {
runTests('dev') runTests('dev')
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(() => { beforeAll(() => {
getStdout = async () => { getStdout = async () => {
const { stdout } = await nextBuild(appDir, [], { stdout: true }) const { stdout } = await nextBuild(appDir, [], { stdout: true })
......
...@@ -336,8 +336,7 @@ describe('Fallback path encoding', () => { ...@@ -336,8 +336,7 @@ describe('Fallback path encoding', () => {
runTests(true) runTests(true)
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await fs.remove(join(appDir, '.next')) await fs.remove(join(appDir, '.next'))
appPort = await findPort() appPort = await findPort()
......
...@@ -76,7 +76,7 @@ function runTests(route, routePath) { ...@@ -76,7 +76,7 @@ function runTests(route, routePath) {
} }
describe('SSG Prerender No Revalidate', () => { describe('SSG Prerender No Revalidate', () => {
describe('production mode', () => { ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await fs.remove(join(appDir, '.next')) await fs.remove(join(appDir, '.next'))
await nextBuild(appDir, []) await nextBuild(appDir, [])
......
...@@ -66,7 +66,7 @@ function runTests(route, routePath) { ...@@ -66,7 +66,7 @@ function runTests(route, routePath) {
} }
describe('SSG Prerender Revalidate', () => { describe('SSG Prerender Revalidate', () => {
describe('production mode', () => { ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await fs.remove(join(appDir, '.next')) await fs.remove(join(appDir, '.next'))
await nextBuild(appDir, []) await nextBuild(appDir, [])
......
...@@ -60,8 +60,7 @@ describe('Relay Compiler Transform - Multi Project Config', () => { ...@@ -60,8 +60,7 @@ describe('Relay Compiler Transform - Multi Project Config', () => {
runTests('Project B') runTests('Project B')
}) })
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
describe('project-a', () => { describe('project-a', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(projectAAppDir, [], { cwd: projectAAppDir }) await nextBuild(projectAAppDir, [], { cwd: projectAAppDir })
......
...@@ -41,8 +41,7 @@ describe('Relay Compiler Transform - Single Project Config', () => { ...@@ -41,8 +41,7 @@ describe('Relay Compiler Transform - Single Project Config', () => {
runTests() runTests()
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
runRelayCompiler() runRelayCompiler()
await nextBuild(appDir, [], { cwd: appDir }) await nextBuild(appDir, [], { cwd: appDir })
......
...@@ -48,8 +48,7 @@ describe('rewrites persist with browser history actions', () => { ...@@ -48,8 +48,7 @@ describe('rewrites persist with browser history actions', () => {
runTests() runTests()
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
appPort = await findPort() appPort = await findPort()
......
...@@ -70,8 +70,7 @@ describe('Client-side rewrites resolving', () => { ...@@ -70,8 +70,7 @@ describe('Client-side rewrites resolving', () => {
runTests() runTests()
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
await nextBuild(appDir) await nextBuild(appDir)
......
...@@ -32,8 +32,7 @@ describe('rewrites destination query', () => { ...@@ -32,8 +32,7 @@ describe('rewrites destination query', () => {
runTests() runTests()
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
appPort = await findPort() appPort = await findPort()
......
...@@ -55,8 +55,7 @@ describe('rewrites has condition', () => { ...@@ -55,8 +55,7 @@ describe('rewrites has condition', () => {
runTests() runTests()
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
appPort = await findPort() appPort = await findPort()
......
...@@ -169,8 +169,7 @@ describe('rewrites manual href/as', () => { ...@@ -169,8 +169,7 @@ describe('rewrites manual href/as', () => {
runTests() runTests()
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
appPort = await findPort() appPort = await findPort()
......
...@@ -60,7 +60,7 @@ const runTests = () => { ...@@ -60,7 +60,7 @@ const runTests = () => {
} }
describe('Root Optional Catch-all Revalidate', () => { describe('Root Optional Catch-all Revalidate', () => {
describe('production mode', () => { ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
appPort = await findPort() appPort = await findPort()
......
...@@ -57,8 +57,7 @@ describe('Route index handling', () => { ...@@ -57,8 +57,7 @@ describe('Route index handling', () => {
runTests() runTests()
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
appPort = await findPort() appPort = await findPort()
......
...@@ -122,8 +122,7 @@ describe('Route indexes handling', () => { ...@@ -122,8 +122,7 @@ describe('Route indexes handling', () => {
runTests() runTests()
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
appPort = await findPort() appPort = await findPort()
......
...@@ -44,8 +44,7 @@ describe('next/dynamic', () => { ...@@ -44,8 +44,7 @@ describe('next/dynamic', () => {
runTests(true) runTests(true)
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await runNextCommand(['build', appDir]) await runNextCommand(['build', appDir])
......
...@@ -36,8 +36,7 @@ describe('router.isReady', () => { ...@@ -36,8 +36,7 @@ describe('router.isReady', () => {
runTests() runTests()
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
......
...@@ -61,8 +61,7 @@ describe('router.isReady with appGip', () => { ...@@ -61,8 +61,7 @@ describe('router.isReady with appGip', () => {
runTests() runTests()
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
......
...@@ -91,8 +91,7 @@ describe('router.isReady', () => { ...@@ -91,8 +91,7 @@ describe('router.isReady', () => {
runTests() runTests()
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
......
...@@ -48,8 +48,7 @@ describe('Router prefetch', () => { ...@@ -48,8 +48,7 @@ describe('Router prefetch', () => {
await didResolveAfterPrefetch() await didResolveAfterPrefetch()
}) })
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
appPort = await findPort() appPort = await findPort()
......
...@@ -42,8 +42,7 @@ describe('router rerender', () => { ...@@ -42,8 +42,7 @@ describe('router rerender', () => {
runTests() runTests()
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
appPort = await findPort() appPort = await findPort()
......
...@@ -35,8 +35,7 @@ describe('serverside asset modules', () => { ...@@ -35,8 +35,7 @@ describe('serverside asset modules', () => {
runTests() runTests()
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
......
...@@ -36,8 +36,7 @@ describe('Dynamic Routing', () => { ...@@ -36,8 +36,7 @@ describe('Dynamic Routing', () => {
runTests(true) runTests(true)
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
......
...@@ -85,8 +85,7 @@ describe('Dynamic Routing', () => { ...@@ -85,8 +85,7 @@ describe('Dynamic Routing', () => {
runTests(true) runTests(true)
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
appPort = await findPort() appPort = await findPort()
......
...@@ -81,8 +81,7 @@ describe('SSG data 404', () => { ...@@ -81,8 +81,7 @@ describe('SSG data 404', () => {
runTests() runTests()
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
......
...@@ -39,8 +39,7 @@ describe('Static Page Name', () => { ...@@ -39,8 +39,7 @@ describe('Static Page Name', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests() runTests()
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
await nextBuild(appDir) await nextBuild(appDir)
......
...@@ -21,7 +21,7 @@ function runTests() { ...@@ -21,7 +21,7 @@ function runTests() {
} }
describe('styled-jsx using in node_modules', () => { describe('styled-jsx using in node_modules', () => {
describe('production mode', () => { ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
const output = await nextBuild(appDir, undefined, { const output = await nextBuild(appDir, undefined, {
stdout: true, stdout: true,
......
...@@ -102,8 +102,7 @@ describe('href resolving trailing-slash', () => { ...@@ -102,8 +102,7 @@ describe('href resolving trailing-slash', () => {
runTests(true) runTests(true)
}) })
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
appPort = await findPort() appPort = await findPort()
......
...@@ -46,7 +46,7 @@ const runTests = () => { ...@@ -46,7 +46,7 @@ const runTests = () => {
} }
describe('Trailing Slash Rewrite Proxying', () => { describe('Trailing Slash Rewrite Proxying', () => {
describe('production mode', () => { ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
proxyPort = await findPort() proxyPort = await findPort()
proxyServer = await initNextServerScript( proxyServer = await initNextServerScript(
......
...@@ -234,76 +234,81 @@ describe('Trailing slashes', () => { ...@@ -234,76 +234,81 @@ describe('Trailing slashes', () => {
testWithTrailingSlash() testWithTrailingSlash()
}) })
;(process.env.TURBOPACK ? describe.skip : describe)(
describe('production mode, trailingSlash: false', () => { 'production mode, trailingSlash: false',
beforeAll(async () => { () => {
nextConfig.replace('// trailingSlash: boolean', 'trailingSlash: false') beforeAll(async () => {
await nextBuild(appDir) nextConfig.replace('// trailingSlash: boolean', 'trailingSlash: false')
appPort = await findPort() await nextBuild(appDir)
app = await nextStart(appDir, appPort) appPort = await findPort()
}) app = await nextStart(appDir, appPort)
afterAll(async () => { })
nextConfig.restore() afterAll(async () => {
await killApp(app) nextConfig.restore()
}) await killApp(app)
})
testWithoutTrailingSlash()
testWithoutTrailingSlash()
it('should have a redirect in the routesmanifest', async () => {
const manifest = await fs.readJSON( it('should have a redirect in the routesmanifest', async () => {
join(appDir, '.next', 'routes-manifest.json') const manifest = await fs.readJSON(
) join(appDir, '.next', 'routes-manifest.json')
expect(manifest).toEqual( )
expect.objectContaining({ expect(manifest).toEqual(
redirects: expect.arrayContaining([ expect.objectContaining({
expect.objectContaining({ redirects: expect.arrayContaining([
source: '/:path+/', expect.objectContaining({
destination: '/:path+', source: '/:path+/',
statusCode: 308, destination: '/:path+',
}), statusCode: 308,
]), }),
}) ]),
) })
}) )
}) })
}
describe('production mode, trailingSlash: true', () => { )
beforeAll(async () => { ;(process.env.TURBOPACK ? describe.skip : describe)(
nextConfig.replace('// trailingSlash: boolean', 'trailingSlash: true') 'production mode, trailingSlash: true',
await nextBuild(appDir) () => {
appPort = await findPort() beforeAll(async () => {
app = await nextStart(appDir, appPort) nextConfig.replace('// trailingSlash: boolean', 'trailingSlash: true')
}) await nextBuild(appDir)
afterAll(async () => { appPort = await findPort()
nextConfig.restore() app = await nextStart(appDir, appPort)
await killApp(app) })
}) afterAll(async () => {
nextConfig.restore()
testWithTrailingSlash() await killApp(app)
})
it('should have a redirect in the routesmanifest', async () => {
const manifest = await fs.readJSON( testWithTrailingSlash()
join(appDir, '.next', 'routes-manifest.json')
) it('should have a redirect in the routesmanifest', async () => {
expect(manifest).toEqual( const manifest = await fs.readJSON(
expect.objectContaining({ join(appDir, '.next', 'routes-manifest.json')
redirects: expect.arrayContaining([ )
expect.objectContaining({ expect(manifest).toEqual(
source: expect.objectContaining({
'/:file((?!\\.well-known(?:/.*)?)(?:[^/]+/)*[^/]+\\.\\w+)/', redirects: expect.arrayContaining([
destination: '/:file', expect.objectContaining({
statusCode: 308, source:
}), '/:file((?!\\.well-known(?:/.*)?)(?:[^/]+/)*[^/]+\\.\\w+)/',
expect.objectContaining({ destination: '/:file',
source: '/:notfile((?!\\.well-known(?:/.*)?)(?:[^/]+/)*[^/\\.]+)', statusCode: 308,
destination: '/:notfile/', }),
statusCode: 308, expect.objectContaining({
}), source:
]), '/:notfile((?!\\.well-known(?:/.*)?)(?:[^/]+/)*[^/\\.]+)',
}) destination: '/:notfile/',
) statusCode: 308,
}) }),
}) ]),
})
)
})
}
)
describe('dev mode, with basepath, trailingSlash: true', () => { describe('dev mode, with basepath, trailingSlash: true', () => {
beforeAll(async () => { beforeAll(async () => {
...@@ -329,30 +334,32 @@ describe('Trailing slashes', () => { ...@@ -329,30 +334,32 @@ describe('Trailing slashes', () => {
['/docs/linker?href=/', '/docs/'], ['/docs/linker?href=/', '/docs/'],
]) ])
}) })
;(process.env.TURBOPACK ? describe.skip : describe)(
describe('production mode, with basepath, trailingSlash: true', () => { 'production mode, with basepath, trailingSlash: true',
beforeAll(async () => { () => {
nextConfig.replace('// trailingSlash: boolean', 'trailingSlash: true') beforeAll(async () => {
nextConfig.replace('// basePath:', 'basePath:') nextConfig.replace('// trailingSlash: boolean', 'trailingSlash: true')
await nextBuild(appDir) nextConfig.replace('// basePath:', 'basePath:')
appPort = await findPort() await nextBuild(appDir)
app = await nextStart(appDir, appPort) appPort = await findPort()
}) app = await nextStart(appDir, appPort)
afterAll(async () => { })
nextConfig.restore() afterAll(async () => {
await killApp(app) nextConfig.restore()
}) await killApp(app)
})
testShouldRedirect([
['/docs/about', '/docs/about/'], testShouldRedirect([
['/docs', '/docs/'], ['/docs/about', '/docs/about/'],
['/docs/catch-all/hello/world', '/docs/catch-all/hello/world/'], ['/docs', '/docs/'],
['/docs/catch-all/hello.world/', '/docs/catch-all/hello.world'], ['/docs/catch-all/hello/world', '/docs/catch-all/hello/world/'],
]) ['/docs/catch-all/hello.world/', '/docs/catch-all/hello.world'],
])
testLinkShouldRewriteTo([
['/docs/linker?href=/about', '/docs/about/'], testLinkShouldRewriteTo([
['/docs/linker?href=/', '/docs/'], ['/docs/linker?href=/about', '/docs/about/'],
]) ['/docs/linker?href=/', '/docs/'],
}) ])
}
)
}) })
...@@ -28,7 +28,7 @@ const runTests = () => { ...@@ -28,7 +28,7 @@ const runTests = () => {
} }
describe('TypeScript onlyRemoveTypeImports', () => { describe('TypeScript onlyRemoveTypeImports', () => {
describe('production mode', () => { ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
const { code } = await nextBuild(appDir) const { code } = await nextBuild(appDir)
if (code !== 0) throw new Error(`build failed with code ${code}`) if (code !== 0) throw new Error(`build failed with code ${code}`)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment