diff --git a/test/integration/404-page-app/test/index.test.js b/test/integration/404-page-app/test/index.test.js index 91dd07efa4ae..8d0ffa458428 100644 --- a/test/integration/404-page-app/test/index.test.js +++ b/test/integration/404-page-app/test/index.test.js @@ -21,7 +21,7 @@ let appPort let app describe('404 Page Support with _app', () => { - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { afterAll(() => killApp(app)) it('should build successfully', async () => { diff --git a/test/integration/amphtml/test/index.test.js b/test/integration/amphtml/test/index.test.js index e6f2d0474d75..3936dc4026c0 100644 --- a/test/integration/amphtml/test/index.test.js +++ b/test/integration/amphtml/test/index.test.js @@ -25,7 +25,7 @@ let app const context = {} describe('AMP Usage', () => { - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { let output = '' beforeAll(async () => { diff --git a/test/integration/app-tree/test/index.test.js b/test/integration/app-tree/test/index.test.js index 724be1cf6ebc..d0945d49c8c3 100644 --- a/test/integration/app-tree/test/index.test.js +++ b/test/integration/app-tree/test/index.test.js @@ -56,8 +56,7 @@ describe('AppTree', () => { afterAll(() => killApp(app)) runTests() }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await nextBuild(appDir) appPort = await findPort() diff --git a/test/integration/app-types/app-types.test.js b/test/integration/app-types/app-types.test.js index 64b0fa3514f4..4cc4ffe5236a 100644 --- a/test/integration/app-types/app-types.test.js +++ b/test/integration/app-types/app-types.test.js @@ -7,7 +7,7 @@ import { nextBuild } from 'next-test-utils' const appDir = __dirname describe('app type checking', () => { - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { let stderr, errors beforeAll(async () => { stderr = (await nextBuild(appDir, [], { stderr: true })).stderr diff --git a/test/integration/async-modules/test/index.test.js b/test/integration/async-modules/test/index.test.js index a878641652ab..4daef2d611e4 100644 --- a/test/integration/async-modules/test/index.test.js +++ b/test/integration/async-modules/test/index.test.js @@ -115,8 +115,7 @@ describe('Async modules', () => { runTests(true) }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await nextBuild(appDir) appPort = await findPort() diff --git a/test/integration/basepath-root-catch-all/test/index.test.js b/test/integration/basepath-root-catch-all/test/index.test.js index 6af60f1f2d4e..3361256d9c91 100644 --- a/test/integration/basepath-root-catch-all/test/index.test.js +++ b/test/integration/basepath-root-catch-all/test/index.test.js @@ -37,8 +37,7 @@ describe('dev mode', () => { afterAll(() => killApp(app)) runTests() }) - -describe('production mode', () => { +;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await nextBuild(appDir) buildId = await fs.readFile(join(appDir, '.next/BUILD_ID'), 'utf8') diff --git a/test/integration/client-404/test/index.test.js b/test/integration/client-404/test/index.test.js index 4c013b2ba04f..6659846053cc 100644 --- a/test/integration/client-404/test/index.test.js +++ b/test/integration/client-404/test/index.test.js @@ -35,8 +35,7 @@ describe('Client 404', () => { runTests() }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await nextBuild(appDir) context.appPort = await findPort() diff --git a/test/integration/client-shallow-routing/test/index.test.js b/test/integration/client-shallow-routing/test/index.test.js index d8842c4695b1..39cefb994d5b 100644 --- a/test/integration/client-shallow-routing/test/index.test.js +++ b/test/integration/client-shallow-routing/test/index.test.js @@ -97,8 +97,7 @@ describe('Client Shallow Routing', () => { runTests() }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await nextBuild(appDir) appPort = await findPort() diff --git a/test/integration/css/test/css-modules.test.js b/test/integration/css/test/css-modules.test.js index f2868d65ad44..d2eb4591b5b6 100644 --- a/test/integration/css/test/css-modules.test.js +++ b/test/integration/css/test/css-modules.test.js @@ -93,8 +93,7 @@ describe('Basic CSS Modules Ordering', () => { tests() }) - - describe('Production Mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await remove(join(appDir, '.next')) }) @@ -436,8 +435,7 @@ describe('CSS Modules Composes Ordering', () => { tests(true) }) - - describe('Production Mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await remove(join(appDir, '.next')) }) diff --git a/test/integration/css/test/css-rendering.test.js b/test/integration/css/test/css-rendering.test.js index 846b74ddf976..68adeef2c866 100644 --- a/test/integration/css/test/css-rendering.test.js +++ b/test/integration/css/test/css-rendering.test.js @@ -168,21 +168,24 @@ describe('CSS Support', () => { }) } - describe('Production Mode', () => { - beforeAll(async () => { - await remove(join(appDir, '.next')) - }) - beforeAll(async () => { - await nextBuild(appDir, [], {}) - appPort = await findPort() - app = await nextStart(appDir, appPort) - }) - afterAll(async () => { - await killApp(app) - }) - - tests() - }) + ;(process.env.TURBOPACK ? describe.skip : describe)( + 'production mode', + () => { + beforeAll(async () => { + await remove(join(appDir, '.next')) + }) + beforeAll(async () => { + await nextBuild(appDir, [], {}) + appPort = await findPort() + app = await nextStart(appDir, appPort) + }) + afterAll(async () => { + await killApp(app) + }) + + tests() + } + ) }) describe('CSS Cleanup on Render Failure', () => { @@ -231,21 +234,24 @@ describe('CSS Support', () => { }) } - describe('Production Mode', () => { - beforeAll(async () => { - await remove(join(appDir, '.next')) - }) - beforeAll(async () => { - await nextBuild(appDir, [], {}) - appPort = await findPort() - app = await nextStart(appDir, appPort) - }) - afterAll(async () => { - await killApp(app) - }) - - tests() - }) + ;(process.env.TURBOPACK ? describe.skip : describe)( + 'production mode', + () => { + beforeAll(async () => { + await remove(join(appDir, '.next')) + }) + beforeAll(async () => { + await nextBuild(appDir, [], {}) + appPort = await findPort() + app = await nextStart(appDir, appPort) + }) + afterAll(async () => { + await killApp(app) + }) + + tests() + } + ) }) describe('Page reload on CSS missing', () => { @@ -280,31 +286,34 @@ describe('CSS Support', () => { }) } - describe('Production Mode', () => { - beforeAll(async () => { - await remove(join(appDir, '.next')) - }) - beforeAll(async () => { - await nextBuild(appDir, [], {}) - appPort = await findPort() - app = await nextStart(appDir, appPort) - - // Remove other page CSS files: - const manifest = await readJSON( - join(appDir, '.next', 'build-manifest.json') - ) - const files = manifest['pages']['/other'].filter((e) => - e.endsWith('.css') - ) - if (files.length < 1) throw new Error() - await Promise.all(files.map((f) => remove(join(appDir, '.next', f)))) - }) - afterAll(async () => { - await killApp(app) - }) - - tests() - }) + ;(process.env.TURBOPACK ? describe.skip : describe)( + 'production mode', + () => { + beforeAll(async () => { + await remove(join(appDir, '.next')) + }) + beforeAll(async () => { + await nextBuild(appDir, [], {}) + appPort = await findPort() + app = await nextStart(appDir, appPort) + + // Remove other page CSS files: + const manifest = await readJSON( + join(appDir, '.next', 'build-manifest.json') + ) + const files = manifest['pages']['/other'].filter((e) => + e.endsWith('.css') + ) + if (files.length < 1) throw new Error() + await Promise.all(files.map((f) => remove(join(appDir, '.next', f)))) + }) + afterAll(async () => { + await killApp(app) + }) + + tests() + } + ) }) describe('Page hydrates with CSS and not waiting on dependencies', () => { @@ -373,34 +382,37 @@ describe('CSS Support', () => { }) } - describe('Production Mode', () => { - beforeAll(async () => { - await remove(join(appDir, '.next')) - }) - beforeAll(async () => { - await nextBuild(appDir, [], {}) - appPort = await findPort() - app = await nextStart(appDir, appPort) - - const buildId = ( - await readFile(join(appDir, '.next', 'BUILD_ID'), 'utf8') - ).trim() - const fileName = join( - appDir, - '.next/static/', - buildId, - '_buildManifest.js' - ) - if (!(await pathExists(fileName))) { - throw new Error('Missing build manifest') - } - await remove(fileName) - }) - afterAll(async () => { - await killApp(app) - }) - - tests() - }) + ;(process.env.TURBOPACK ? describe.skip : describe)( + 'production mode', + () => { + beforeAll(async () => { + await remove(join(appDir, '.next')) + }) + beforeAll(async () => { + await nextBuild(appDir, [], {}) + appPort = await findPort() + app = await nextStart(appDir, appPort) + + const buildId = ( + await readFile(join(appDir, '.next', 'BUILD_ID'), 'utf8') + ).trim() + const fileName = join( + appDir, + '.next/static/', + buildId, + '_buildManifest.js' + ) + if (!(await pathExists(fileName))) { + throw new Error('Missing build manifest') + } + await remove(fileName) + }) + afterAll(async () => { + await killApp(app) + }) + + tests() + } + ) }) }) diff --git a/test/integration/custom-error/test/index.test.js b/test/integration/custom-error/test/index.test.js index 48d2ed6dd4bc..90ef0465e98d 100644 --- a/test/integration/custom-error/test/index.test.js +++ b/test/integration/custom-error/test/index.test.js @@ -79,8 +79,7 @@ describe('Custom _error', () => { expect(html).toContain('An error 404 occurred on server') }) }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { let buildOutput = '' beforeAll(async () => { diff --git a/test/integration/custom-page-extension/test/index.test.js b/test/integration/custom-page-extension/test/index.test.js index 8ed1b5b63ddc..96e5c1361af5 100644 --- a/test/integration/custom-page-extension/test/index.test.js +++ b/test/integration/custom-page-extension/test/index.test.js @@ -35,8 +35,7 @@ describe('Custom page extension', () => { afterAll(() => killApp(app)) runTests() }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await nextBuild(appDir) appPort = await findPort() diff --git a/test/integration/custom-routes-catchall/test/index.test.js b/test/integration/custom-routes-catchall/test/index.test.js index 6deb24a13ae9..856fbedf1a32 100644 --- a/test/integration/custom-routes-catchall/test/index.test.js +++ b/test/integration/custom-routes-catchall/test/index.test.js @@ -53,8 +53,7 @@ describe('Custom routes', () => { afterAll(() => killApp(app)) runTests(true) }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await nextBuild(appDir) appPort = await findPort() diff --git a/test/integration/custom-routes-i18n-index-redirect/test/index.test.js b/test/integration/custom-routes-i18n-index-redirect/test/index.test.js index 2b73305e6e86..5639384352e9 100644 --- a/test/integration/custom-routes-i18n-index-redirect/test/index.test.js +++ b/test/integration/custom-routes-i18n-index-redirect/test/index.test.js @@ -69,8 +69,7 @@ describe('Custom routes i18n with index redirect', () => { afterAll(() => killApp(app)) runTests(true) }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await nextBuild(appDir) appPort = await findPort() diff --git a/test/integration/custom-routes-i18n/test/index.test.js b/test/integration/custom-routes-i18n/test/index.test.js index 26a56f9d59ee..266432fc8f33 100644 --- a/test/integration/custom-routes-i18n/test/index.test.js +++ b/test/integration/custom-routes-i18n/test/index.test.js @@ -176,8 +176,7 @@ describe('Custom routes i18n', () => { afterAll(() => killApp(app)) runTests(true) }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await nextBuild(appDir) appPort = await findPort() diff --git a/test/integration/custom-routes/test/index.test.js b/test/integration/custom-routes/test/index.test.js index 18d63877cffd..4e9beda10979 100644 --- a/test/integration/custom-routes/test/index.test.js +++ b/test/integration/custom-routes/test/index.test.js @@ -2970,9 +2970,11 @@ describe('Custom routes', () => { describe('dev mode', () => { runSoloTests(true) }) - - describe('production mode', () => { - runSoloTests() - }) + ;(process.env.TURBOPACK ? describe.skip : describe)( + 'production mode', + () => { + runSoloTests() + } + ) }) }) diff --git a/test/integration/disable-js/test/index.test.js b/test/integration/disable-js/test/index.test.js index 336230e50bfa..914625304a24 100644 --- a/test/integration/disable-js/test/index.test.js +++ b/test/integration/disable-js/test/index.test.js @@ -18,7 +18,7 @@ let app const context = {} describe('disabled runtime JS', () => { - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { appPort = await findPort() diff --git a/test/integration/document-file-dependencies/test/index.test.js b/test/integration/document-file-dependencies/test/index.test.js index 560fc57e1021..d1ae19acb877 100644 --- a/test/integration/document-file-dependencies/test/index.test.js +++ b/test/integration/document-file-dependencies/test/index.test.js @@ -10,7 +10,7 @@ let appPort let app describe('File Dependencies', () => { - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { appPort = await findPort() await nextBuild(appDir) diff --git a/test/integration/dynamic-optional-routing-root-fallback/test/index.test.js b/test/integration/dynamic-optional-routing-root-fallback/test/index.test.js index 7f4ace18698b..07bb4e522f47 100644 --- a/test/integration/dynamic-optional-routing-root-fallback/test/index.test.js +++ b/test/integration/dynamic-optional-routing-root-fallback/test/index.test.js @@ -62,8 +62,7 @@ describe('Dynamic Optional Routing Root Fallback', () => { runTests() }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await fs.remove(join(appDir, '.next')) diff --git a/test/integration/dynamic-optional-routing-root-static-paths/test/index.test.js b/test/integration/dynamic-optional-routing-root-static-paths/test/index.test.js index c396dbfccffd..f15238638108 100644 --- a/test/integration/dynamic-optional-routing-root-static-paths/test/index.test.js +++ b/test/integration/dynamic-optional-routing-root-static-paths/test/index.test.js @@ -48,8 +48,7 @@ describe('Dynamic Optional Routing', () => { runTests() }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { const curConfig = await fs.readFile(nextConfig, 'utf8') diff --git a/test/integration/dynamic-optional-routing/test/index.test.js b/test/integration/dynamic-optional-routing/test/index.test.js index aec8b8dd75cc..a61f2799f4d4 100644 --- a/test/integration/dynamic-optional-routing/test/index.test.js +++ b/test/integration/dynamic-optional-routing/test/index.test.js @@ -255,8 +255,7 @@ describe('Dynamic Optional Routing', () => { }) }) }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { const curConfig = await fs.readFile(nextConfig, 'utf8') diff --git a/test/integration/dynamic-routing/test/index.test.js b/test/integration/dynamic-routing/test/index.test.js index d04b18bb10eb..704a7e10dd89 100644 --- a/test/integration/dynamic-routing/test/index.test.js +++ b/test/integration/dynamic-routing/test/index.test.js @@ -1569,8 +1569,7 @@ describe('Dynamic Routing', () => { runTests({ dev: true }) }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await fs.remove(nextConfig) diff --git a/test/integration/edge-runtime-dynamic-code/test/index.test.js b/test/integration/edge-runtime-dynamic-code/test/index.test.js index f9b41e549b34..436adb99d010 100644 --- a/test/integration/edge-runtime-dynamic-code/test/index.test.js +++ b/test/integration/edge-runtime-dynamic-code/test/index.test.js @@ -158,23 +158,29 @@ describe.each([ expect(output).not.toContain('DynamicWasmCodeGenerationWarning') }) }) - - describe('production mode', () => { - let buildResult - - beforeAll(async () => { - buildResult = await nextBuild(context.appDir, undefined, { - stderr: true, - stdout: true, + ;(process.env.TURBOPACK ? describe.skip : describe)( + 'production mode', + () => { + let buildResult + + beforeAll(async () => { + buildResult = await nextBuild(context.appDir, undefined, { + stderr: true, + stdout: true, + }) }) - }) - it('should have middleware warning during build', () => { - expect(buildResult.stderr).toContain(`Failed to compile`) - expect(buildResult.stderr).toContain(`Used by usingEval, usingEvalSync`) - expect(buildResult.stderr).toContain(`Used by usingWebAssemblyCompile`) - expect(buildResult.stderr).toContain(DYNAMIC_CODE_ERROR) - }) - }) + it('should have middleware warning during build', () => { + expect(buildResult.stderr).toContain(`Failed to compile`) + expect(buildResult.stderr).toContain( + `Used by usingEval, usingEvalSync` + ) + expect(buildResult.stderr).toContain( + `Used by usingWebAssemblyCompile` + ) + expect(buildResult.stderr).toContain(DYNAMIC_CODE_ERROR) + }) + } + ) } ) diff --git a/test/integration/edge-runtime-streaming-error/test/index.test.ts b/test/integration/edge-runtime-streaming-error/test/index.test.ts index 3e18602a12cf..e6e3cf9e02e4 100644 --- a/test/integration/edge-runtime-streaming-error/test/index.test.ts +++ b/test/integration/edge-runtime-streaming-error/test/index.test.ts @@ -65,8 +65,7 @@ describe('dev mode', () => { it('logs the error correctly', test(context)) }) - -describe('production mode', () => { +;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { const context = createContext() beforeAll(async () => { diff --git a/test/integration/edge-runtime-with-node.js-apis/test/index.test.ts b/test/integration/edge-runtime-with-node.js-apis/test/index.test.ts index 1e749644b7a6..d2d6d99a7e98 100644 --- a/test/integration/edge-runtime-with-node.js-apis/test/index.test.ts +++ b/test/integration/edge-runtime-with-node.js-apis/test/index.test.ts @@ -110,8 +110,7 @@ Learn more: https://nextjs.org/docs/api-reference/edge-runtime`) expect(stripAnsi(output)).toInclude(errorHighlight) }) }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { let buildResult beforeAll(async () => { diff --git a/test/integration/fallback-false-rewrite/test/index.test.js b/test/integration/fallback-false-rewrite/test/index.test.js index 1519c254d32c..d2129754c4e2 100644 --- a/test/integration/fallback-false-rewrite/test/index.test.js +++ b/test/integration/fallback-false-rewrite/test/index.test.js @@ -117,8 +117,7 @@ describe('fallback: false rewrite', () => { runTests() }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await fs.remove(join(appDir, '.next')) await nextBuild(appDir, []) diff --git a/test/integration/fallback-route-params/test/index.test.js b/test/integration/fallback-route-params/test/index.test.js index b8509556e7f8..000761425b74 100644 --- a/test/integration/fallback-route-params/test/index.test.js +++ b/test/integration/fallback-route-params/test/index.test.js @@ -50,8 +50,7 @@ describe('Fallback Dynamic Route Params', () => { runTests() }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await fs.remove(join(appDir, '.next')) await nextBuild(appDir, []) diff --git a/test/integration/file-serving/test/index.test.js b/test/integration/file-serving/test/index.test.js index a0f73e8399c6..18683c60bee2 100644 --- a/test/integration/file-serving/test/index.test.js +++ b/test/integration/file-serving/test/index.test.js @@ -4482,8 +4482,7 @@ describe('File Serving', () => { runTests(true) }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { const { code } = await nextBuild(appDir) diff --git a/test/integration/getinitialprops/test/index.test.js b/test/integration/getinitialprops/test/index.test.js index be346ac37a6e..f062bb5c2aa2 100644 --- a/test/integration/getinitialprops/test/index.test.js +++ b/test/integration/getinitialprops/test/index.test.js @@ -49,8 +49,7 @@ describe('getInitialProps', () => { runTests() }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await nextBuild(appDir) appPort = await findPort() diff --git a/test/integration/getserversideprops-export-error/test/index.test.js b/test/integration/getserversideprops-export-error/test/index.test.js index abfd90d32f10..251377f3af48 100644 --- a/test/integration/getserversideprops-export-error/test/index.test.js +++ b/test/integration/getserversideprops-export-error/test/index.test.js @@ -29,7 +29,7 @@ const runTests = () => { } describe('getServerSideProps', () => { - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await fs.remove(nextConfig) await fs.remove(join(appDir, '.next')) diff --git a/test/integration/gip-identifier/test/index.test.js b/test/integration/gip-identifier/test/index.test.js index 78bc7e11587e..8523c075dc7b 100644 --- a/test/integration/gip-identifier/test/index.test.js +++ b/test/integration/gip-identifier/test/index.test.js @@ -90,8 +90,7 @@ describe('gip identifiers', () => { describe('dev mode', () => { runTests(true) }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { runTests() }) }) diff --git a/test/integration/gssp-pageProps-merge/test/index.test.js b/test/integration/gssp-pageProps-merge/test/index.test.js index 756071025c3a..895702ee22e9 100644 --- a/test/integration/gssp-pageProps-merge/test/index.test.js +++ b/test/integration/gssp-pageProps-merge/test/index.test.js @@ -40,8 +40,7 @@ describe('pageProps GSSP conflict', () => { runTests() }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { const { code } = await nextBuild(appDir) if (code !== 0) throw new Error(`build failed with code ${code}`) diff --git a/test/integration/gssp-redirect-base-path/test/index.test.js b/test/integration/gssp-redirect-base-path/test/index.test.js index d173dcc048d8..055e9824ea29 100644 --- a/test/integration/gssp-redirect-base-path/test/index.test.js +++ b/test/integration/gssp-redirect-base-path/test/index.test.js @@ -489,8 +489,7 @@ describe('GS(S)P Redirect Support', () => { runTests(true) }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await fs.remove(join(appDir, '.next')) await nextBuild(appDir) diff --git a/test/integration/gssp-redirect/test/index.test.js b/test/integration/gssp-redirect/test/index.test.js index 97385309557b..2c52a55c5186 100644 --- a/test/integration/gssp-redirect/test/index.test.js +++ b/test/integration/gssp-redirect/test/index.test.js @@ -514,8 +514,7 @@ describe('GS(S)P Redirect Support', () => { runTests(true) }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { let output = '' beforeAll(async () => { diff --git a/test/integration/hashbang/test/index.test.js b/test/integration/hashbang/test/index.test.js index 89a881b6a761..92f43f9adf36 100644 --- a/test/integration/hashbang/test/index.test.js +++ b/test/integration/hashbang/test/index.test.js @@ -46,8 +46,7 @@ describe('Hashbang', () => { runTests(true) }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await fs.remove(nextConfig) await nextBuild(appDir) diff --git a/test/integration/hydration/test/index.test.js b/test/integration/hydration/test/index.test.js index aa540363504d..e1b27e5b0c81 100644 --- a/test/integration/hydration/test/index.test.js +++ b/test/integration/hydration/test/index.test.js @@ -50,8 +50,7 @@ describe('Hydration', () => { runTests() }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await fs.remove(path.join(appDir, '.next')) await nextBuild(appDir) diff --git a/test/integration/i18n-support-base-path/test/index.test.js b/test/integration/i18n-support-base-path/test/index.test.js index 0e99499c2b68..66045f8519aa 100644 --- a/test/integration/i18n-support-base-path/test/index.test.js +++ b/test/integration/i18n-support-base-path/test/index.test.js @@ -59,8 +59,7 @@ describe('i18n Support basePath', () => { runTests(curCtx) }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { nextConfig.replace(/__EXTERNAL_PORT__/g, ctx.externalPort) await fs.remove(join(appDir, '.next')) diff --git a/test/integration/i18n-support-catchall/test/index.test.js b/test/integration/i18n-support-catchall/test/index.test.js index c3cee248718b..7e2d8f6fed95 100644 --- a/test/integration/i18n-support-catchall/test/index.test.js +++ b/test/integration/i18n-support-catchall/test/index.test.js @@ -231,8 +231,7 @@ describe('i18n Support Root Catch-all', () => { runTests(true) }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await fs.remove(join(appDir, '.next')) await nextBuild(appDir) diff --git a/test/integration/i18n-support-custom-error/test/index.test.js b/test/integration/i18n-support-custom-error/test/index.test.js index 06f9e8713ed4..cadd15d9c9d2 100644 --- a/test/integration/i18n-support-custom-error/test/index.test.js +++ b/test/integration/i18n-support-custom-error/test/index.test.js @@ -116,8 +116,7 @@ describe('Custom routes i18n', () => { afterAll(() => killApp(app)) runTests(true) }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await nextBuild(appDir) appPort = await findPort() diff --git a/test/integration/i18n-support-fallback-rewrite-legacy/test/index.test.js b/test/integration/i18n-support-fallback-rewrite-legacy/test/index.test.js index 3f644cb7f1f8..16adeb8384f9 100644 --- a/test/integration/i18n-support-fallback-rewrite-legacy/test/index.test.js +++ b/test/integration/i18n-support-fallback-rewrite-legacy/test/index.test.js @@ -98,8 +98,7 @@ describe('i18n Support', () => { runTests() }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await fs.remove(join(appDir, '.next')) await nextBuild(appDir) diff --git a/test/integration/i18n-support-fallback-rewrite/test/index.test.js b/test/integration/i18n-support-fallback-rewrite/test/index.test.js index 3f644cb7f1f8..16adeb8384f9 100644 --- a/test/integration/i18n-support-fallback-rewrite/test/index.test.js +++ b/test/integration/i18n-support-fallback-rewrite/test/index.test.js @@ -98,8 +98,7 @@ describe('i18n Support', () => { runTests() }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await fs.remove(join(appDir, '.next')) await nextBuild(appDir) diff --git a/test/integration/i18n-support-index-rewrite/test/index.test.js b/test/integration/i18n-support-index-rewrite/test/index.test.js index 4ce6828ab83a..6ac3afaad83a 100644 --- a/test/integration/i18n-support-index-rewrite/test/index.test.js +++ b/test/integration/i18n-support-index-rewrite/test/index.test.js @@ -84,8 +84,7 @@ describe('Custom routes i18n', () => { afterAll(() => killApp(app)) runTests(true) }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await nextBuild(appDir) appPort = await findPort() diff --git a/test/integration/i18n-support-same-page-hash-change/test/index.test.js b/test/integration/i18n-support-same-page-hash-change/test/index.test.js index a5c9d9d189d5..d75d1be3f42f 100644 --- a/test/integration/i18n-support-same-page-hash-change/test/index.test.js +++ b/test/integration/i18n-support-same-page-hash-change/test/index.test.js @@ -79,8 +79,7 @@ describe('Hash changes i18n', () => { afterAll(() => killApp(app)) runTests(true) }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await nextBuild(appDir) appPort = await findPort() diff --git a/test/integration/i18n-support/test/index.test.js b/test/integration/i18n-support/test/index.test.js index c922bfb16ac8..6a06cc489928 100644 --- a/test/integration/i18n-support/test/index.test.js +++ b/test/integration/i18n-support/test/index.test.js @@ -58,8 +58,7 @@ describe('i18n Support', () => { runTests(curCtx) }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await fs.remove(join(appDir, '.next')) nextConfig.replace(/__EXTERNAL_PORT__/g, ctx.externalPort) @@ -433,26 +432,28 @@ describe('i18n Support', () => { 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', () => { - const curCtx = { - ...ctx, - } - beforeAll(async () => { - await fs.remove(join(appDir, '.next')) - nextConfig.replace('// trailingSlash', 'trailingSlash') - - await nextBuild(appDir) - curCtx.appPort = await findPort() - curCtx.app = await nextStart(appDir, curCtx.appPort) - }) - afterAll(async () => { - nextConfig.restore() - 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', () => { @@ -498,24 +499,26 @@ describe('i18n Support', () => { 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', () => { - 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) - }) + runSlashTests(curCtx) + } + ) }) it('should show proper error for duplicate defaultLocales', async () => { diff --git a/test/integration/index-index/test/index.test.js b/test/integration/index-index/test/index.test.js index f4745335c9ea..bbde7d2bddc0 100644 --- a/test/integration/index-index/test/index.test.js +++ b/test/integration/index-index/test/index.test.js @@ -191,8 +191,7 @@ describe('nested index.js', () => { runTests() }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { const curConfig = await fs.readFile(nextConfig, 'utf8') diff --git a/test/integration/initial-ref/test/index.test.js b/test/integration/initial-ref/test/index.test.js index 29f00ead9f34..913106bb8490 100644 --- a/test/integration/initial-ref/test/index.test.js +++ b/test/integration/initial-ref/test/index.test.js @@ -22,7 +22,7 @@ const runTest = () => { } describe('Initial Refs', () => { - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await nextBuild(appDir) appPort = await findPort() diff --git a/test/integration/invalid-custom-routes/test/index.test.js b/test/integration/invalid-custom-routes/test/index.test.js index e3b50043297c..ea23d3b707e1 100644 --- a/test/integration/invalid-custom-routes/test/index.test.js +++ b/test/integration/invalid-custom-routes/test/index.test.js @@ -598,8 +598,7 @@ describe('Errors on invalid custom routes', () => { runTests() }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(() => { getStderr = async () => { const { stderr } = await nextBuild(appDir, [], { stderr: true }) diff --git a/test/integration/invalid-href/test/index.test.js b/test/integration/invalid-href/test/index.test.js index d7f5566182b4..79a4859bdc36 100644 --- a/test/integration/invalid-href/test/index.test.js +++ b/test/integration/invalid-href/test/index.test.js @@ -84,7 +84,7 @@ const noError = async (pathname, click = false) => { } describe('Invalid hrefs', () => { - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await nextBuild(appDir) appPort = await findPort() diff --git a/test/integration/invalid-middleware-matchers/test/index.test.js b/test/integration/invalid-middleware-matchers/test/index.test.js index bd7b27588e19..0d004de4d3cd 100644 --- a/test/integration/invalid-middleware-matchers/test/index.test.js +++ b/test/integration/invalid-middleware-matchers/test/index.test.js @@ -153,8 +153,7 @@ describe('Errors on invalid custom middleware matchers', () => { runTests() }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(() => { getStderr = async () => { const { stderr } = await nextBuild(appDir, [], { stderr: true }) diff --git a/test/integration/invalid-multi-match/test/index.test.js b/test/integration/invalid-multi-match/test/index.test.js index 622fdade1705..b634f5d7d499 100644 --- a/test/integration/invalid-multi-match/test/index.test.js +++ b/test/integration/invalid-multi-match/test/index.test.js @@ -40,8 +40,7 @@ describe('Custom routes invalid multi-match', () => { afterAll(() => killApp(app)) runTests(true) }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await nextBuild(appDir) appPort = await findPort() diff --git a/test/integration/link-ref/test/index.test.js b/test/integration/link-ref/test/index.test.js index 22640cebbad2..09ff910bd03c 100644 --- a/test/integration/link-ref/test/index.test.js +++ b/test/integration/link-ref/test/index.test.js @@ -83,8 +83,7 @@ describe('Invalid hrefs', () => { await noError('/child-ref-func') }) }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await nextBuild(appDir) appPort = await findPort() diff --git a/test/integration/link-without-router/test/index.test.js b/test/integration/link-without-router/test/index.test.js index 2dca4459812c..054bbc7c772b 100644 --- a/test/integration/link-without-router/test/index.test.js +++ b/test/integration/link-without-router/test/index.test.js @@ -36,8 +36,7 @@ describe('Link without a router', () => { expect(container.textContent).toBe('Click me') }) }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { it('should not throw when rendered', () => { jest.useFakeTimers() diff --git a/test/integration/middleware-src/test/index.test.js b/test/integration/middleware-src/test/index.test.js index 3cd445daa225..e52a7f0962b7 100644 --- a/test/integration/middleware-src/test/index.test.js +++ b/test/integration/middleware-src/test/index.test.js @@ -99,8 +99,7 @@ describe.each([ runTest() }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { let exportOutput = '' beforeAll(async () => { diff --git a/test/integration/next-dynamic-css/test/index.test.js b/test/integration/next-dynamic-css/test/index.test.js index 3dd11cd441f1..f4a6389aca69 100644 --- a/test/integration/next-dynamic-css/test/index.test.js +++ b/test/integration/next-dynamic-css/test/index.test.js @@ -40,8 +40,7 @@ describe('next/dynamic', () => { runTests(true) }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await nextBuild(appDir) appPort = await findPort() diff --git a/test/integration/next-dynamic-lazy-compilation/test/index.test.js b/test/integration/next-dynamic-lazy-compilation/test/index.test.js index 1711b20a795b..b075256aba2c 100644 --- a/test/integration/next-dynamic-lazy-compilation/test/index.test.js +++ b/test/integration/next-dynamic-lazy-compilation/test/index.test.js @@ -56,8 +56,7 @@ describe('next/dynamic', () => { runTests(true) }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await runNextCommand(['build', appDir]) diff --git a/test/integration/next-dynamic/test/index.test.js b/test/integration/next-dynamic/test/index.test.js index 5207e55b64c0..bd65bf4232b3 100644 --- a/test/integration/next-dynamic/test/index.test.js +++ b/test/integration/next-dynamic/test/index.test.js @@ -52,8 +52,7 @@ describe('next/dynamic', () => { runTests(true) }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await runNextCommand(['build', appDir]) diff --git a/test/integration/next-image-legacy/base-path/test/static.test.ts b/test/integration/next-image-legacy/base-path/test/static.test.ts index 34c33dfe3a47..bd3d7c62d5b4 100644 --- a/test/integration/next-image-legacy/base-path/test/static.test.ts +++ b/test/integration/next-image-legacy/base-path/test/static.test.ts @@ -106,7 +106,7 @@ describe('Build Error Tests for basePath', () => { }) }) describe('Static Image Component Tests for basePath', () => { - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await nextBuild(appDir) appPort = await findPort() diff --git a/test/integration/next-image-new/app-dir/test/static.test.ts b/test/integration/next-image-new/app-dir/test/static.test.ts index ae1c4ba17bce..8a2d19ea9a36 100644 --- a/test/integration/next-image-new/app-dir/test/static.test.ts +++ b/test/integration/next-image-new/app-dir/test/static.test.ts @@ -205,7 +205,7 @@ describe('Build Error Tests', () => { }) }) describe('Static Image Component Tests', () => { - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await nextBuild(appDir) appPort = await findPort() diff --git a/test/integration/next-image-new/base-path/test/static.test.js b/test/integration/next-image-new/base-path/test/static.test.js index ac1a95762a98..fda3e2588253 100644 --- a/test/integration/next-image-new/base-path/test/static.test.js +++ b/test/integration/next-image-new/base-path/test/static.test.js @@ -163,7 +163,7 @@ describe('Build Error Tests', () => { }) }) describe('Static Image Component Tests for basePath', () => { - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await nextBuild(appDir) appPort = await findPort() diff --git a/test/integration/next-image-new/default/test/static.test.ts b/test/integration/next-image-new/default/test/static.test.ts index 0151183b6ce8..af3a023fede7 100644 --- a/test/integration/next-image-new/default/test/static.test.ts +++ b/test/integration/next-image-new/default/test/static.test.ts @@ -217,7 +217,7 @@ describe('Build Error Tests', () => { }) }) describe('Static Image Component Tests', () => { - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await nextBuild(appDir) appPort = await findPort() diff --git a/test/integration/no-page-props/test/index.test.js b/test/integration/no-page-props/test/index.test.js index f507e211b61d..a402e49060ee 100644 --- a/test/integration/no-page-props/test/index.test.js +++ b/test/integration/no-page-props/test/index.test.js @@ -89,8 +89,7 @@ describe('Error no pageProps', () => { runTests() }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await nextBuild(appDir) appPort = await findPort() diff --git a/test/integration/not-found-revalidate/test/index.test.js b/test/integration/not-found-revalidate/test/index.test.js index 058e1ee8bd3a..807f8dfd8ac7 100644 --- a/test/integration/not-found-revalidate/test/index.test.js +++ b/test/integration/not-found-revalidate/test/index.test.js @@ -194,7 +194,7 @@ const runTests = () => { } describe('SSG notFound revalidate', () => { - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await fs.remove(join(appDir, '.next')) await nextBuild(appDir, undefined, { diff --git a/test/integration/nullish-config/test/index.test.js b/test/integration/nullish-config/test/index.test.js index b1b169a949df..b26770363a19 100644 --- a/test/integration/nullish-config/test/index.test.js +++ b/test/integration/nullish-config/test/index.test.js @@ -79,8 +79,7 @@ describe('Nullish configs in next.config.js', () => { runTests('dev') }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(() => { getStdout = async () => { const { stdout } = await nextBuild(appDir, [], { stdout: true }) diff --git a/test/integration/prerender-fallback-encoding/test/index.test.js b/test/integration/prerender-fallback-encoding/test/index.test.js index 39e65dbf9d91..efbe6b9f598e 100644 --- a/test/integration/prerender-fallback-encoding/test/index.test.js +++ b/test/integration/prerender-fallback-encoding/test/index.test.js @@ -336,8 +336,7 @@ describe('Fallback path encoding', () => { runTests(true) }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await fs.remove(join(appDir, '.next')) appPort = await findPort() diff --git a/test/integration/prerender-no-revalidate/test/index.test.js b/test/integration/prerender-no-revalidate/test/index.test.js index d7900e988cdc..de66b632d765 100644 --- a/test/integration/prerender-no-revalidate/test/index.test.js +++ b/test/integration/prerender-no-revalidate/test/index.test.js @@ -76,7 +76,7 @@ function runTests(route, routePath) { } describe('SSG Prerender No Revalidate', () => { - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await fs.remove(join(appDir, '.next')) await nextBuild(appDir, []) diff --git a/test/integration/prerender-revalidate/test/index.test.js b/test/integration/prerender-revalidate/test/index.test.js index 63e328653659..701c9f686dc0 100644 --- a/test/integration/prerender-revalidate/test/index.test.js +++ b/test/integration/prerender-revalidate/test/index.test.js @@ -66,7 +66,7 @@ function runTests(route, routePath) { } describe('SSG Prerender Revalidate', () => { - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await fs.remove(join(appDir, '.next')) await nextBuild(appDir, []) diff --git a/test/integration/relay-graphql-swc-multi-project/test/index.test.js b/test/integration/relay-graphql-swc-multi-project/test/index.test.js index 605f06c87527..09364fac64f3 100644 --- a/test/integration/relay-graphql-swc-multi-project/test/index.test.js +++ b/test/integration/relay-graphql-swc-multi-project/test/index.test.js @@ -60,8 +60,7 @@ describe('Relay Compiler Transform - Multi Project Config', () => { runTests('Project B') }) }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { describe('project-a', () => { beforeAll(async () => { await nextBuild(projectAAppDir, [], { cwd: projectAAppDir }) diff --git a/test/integration/relay-graphql-swc-single-project/test/index.test.js b/test/integration/relay-graphql-swc-single-project/test/index.test.js index 0b1918304787..cabf1363fa73 100644 --- a/test/integration/relay-graphql-swc-single-project/test/index.test.js +++ b/test/integration/relay-graphql-swc-single-project/test/index.test.js @@ -41,8 +41,7 @@ describe('Relay Compiler Transform - Single Project Config', () => { runTests() }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { runRelayCompiler() await nextBuild(appDir, [], { cwd: appDir }) diff --git a/test/integration/rewrite-with-browser-history/test/index.test.js b/test/integration/rewrite-with-browser-history/test/index.test.js index 0bed0cdabf66..a701a5a7d5ba 100644 --- a/test/integration/rewrite-with-browser-history/test/index.test.js +++ b/test/integration/rewrite-with-browser-history/test/index.test.js @@ -48,8 +48,7 @@ describe('rewrites persist with browser history actions', () => { runTests() }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await nextBuild(appDir) appPort = await findPort() diff --git a/test/integration/rewrites-client-resolving/test/index.test.js b/test/integration/rewrites-client-resolving/test/index.test.js index d49246cc0269..8955a21067a4 100644 --- a/test/integration/rewrites-client-resolving/test/index.test.js +++ b/test/integration/rewrites-client-resolving/test/index.test.js @@ -70,8 +70,7 @@ describe('Client-side rewrites resolving', () => { runTests() }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { appPort = await findPort() await nextBuild(appDir) diff --git a/test/integration/rewrites-destination-query-array/test/index.test.js b/test/integration/rewrites-destination-query-array/test/index.test.js index 4809374328fd..6c9febd49027 100644 --- a/test/integration/rewrites-destination-query-array/test/index.test.js +++ b/test/integration/rewrites-destination-query-array/test/index.test.js @@ -32,8 +32,7 @@ describe('rewrites destination query', () => { runTests() }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await nextBuild(appDir) appPort = await findPort() diff --git a/test/integration/rewrites-has-condition/test/index.test.js b/test/integration/rewrites-has-condition/test/index.test.js index d15358a77842..a5dc1548ce5d 100644 --- a/test/integration/rewrites-has-condition/test/index.test.js +++ b/test/integration/rewrites-has-condition/test/index.test.js @@ -55,8 +55,7 @@ describe('rewrites has condition', () => { runTests() }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await nextBuild(appDir) appPort = await findPort() diff --git a/test/integration/rewrites-manual-href-as/test/index.test.js b/test/integration/rewrites-manual-href-as/test/index.test.js index 9f92b7c66778..a68c78b6c219 100644 --- a/test/integration/rewrites-manual-href-as/test/index.test.js +++ b/test/integration/rewrites-manual-href-as/test/index.test.js @@ -169,8 +169,7 @@ describe('rewrites manual href/as', () => { runTests() }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await nextBuild(appDir) appPort = await findPort() diff --git a/test/integration/root-optional-revalidate/test/index.test.js b/test/integration/root-optional-revalidate/test/index.test.js index 68612e99a781..9aa6eb6d1c5e 100644 --- a/test/integration/root-optional-revalidate/test/index.test.js +++ b/test/integration/root-optional-revalidate/test/index.test.js @@ -60,7 +60,7 @@ const runTests = () => { } describe('Root Optional Catch-all Revalidate', () => { - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await nextBuild(appDir) appPort = await findPort() diff --git a/test/integration/route-index/test/index.test.js b/test/integration/route-index/test/index.test.js index aacfe325f9d0..004a957341f6 100644 --- a/test/integration/route-index/test/index.test.js +++ b/test/integration/route-index/test/index.test.js @@ -57,8 +57,7 @@ describe('Route index handling', () => { runTests() }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await nextBuild(appDir) appPort = await findPort() diff --git a/test/integration/route-indexes/test/index.test.js b/test/integration/route-indexes/test/index.test.js index c0cd9525dc55..4cd905d999a8 100644 --- a/test/integration/route-indexes/test/index.test.js +++ b/test/integration/route-indexes/test/index.test.js @@ -122,8 +122,7 @@ describe('Route indexes handling', () => { runTests() }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await nextBuild(appDir) appPort = await findPort() diff --git a/test/integration/route-load-cancel/test/index.test.js b/test/integration/route-load-cancel/test/index.test.js index 6b3e33012e33..5c7d997eb6ee 100644 --- a/test/integration/route-load-cancel/test/index.test.js +++ b/test/integration/route-load-cancel/test/index.test.js @@ -44,8 +44,7 @@ describe('next/dynamic', () => { runTests(true) }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await runNextCommand(['build', appDir]) diff --git a/test/integration/router-hash-navigation/test/index.test.js b/test/integration/router-hash-navigation/test/index.test.js index 3e65ed752d12..a7dfead99025 100644 --- a/test/integration/router-hash-navigation/test/index.test.js +++ b/test/integration/router-hash-navigation/test/index.test.js @@ -36,8 +36,7 @@ describe('router.isReady', () => { runTests() }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await nextBuild(appDir) diff --git a/test/integration/router-is-ready-app-gip/test/index.test.js b/test/integration/router-is-ready-app-gip/test/index.test.js index 064089db87ff..617d20018e73 100644 --- a/test/integration/router-is-ready-app-gip/test/index.test.js +++ b/test/integration/router-is-ready-app-gip/test/index.test.js @@ -61,8 +61,7 @@ describe('router.isReady with appGip', () => { runTests() }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await nextBuild(appDir) diff --git a/test/integration/router-is-ready/test/index.test.js b/test/integration/router-is-ready/test/index.test.js index 75aee4fe8359..9fd8b124aea4 100644 --- a/test/integration/router-is-ready/test/index.test.js +++ b/test/integration/router-is-ready/test/index.test.js @@ -91,8 +91,7 @@ describe('router.isReady', () => { runTests() }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await nextBuild(appDir) diff --git a/test/integration/router-prefetch/test/index.test.js b/test/integration/router-prefetch/test/index.test.js index 508054f27072..5900ed9f1b73 100644 --- a/test/integration/router-prefetch/test/index.test.js +++ b/test/integration/router-prefetch/test/index.test.js @@ -48,8 +48,7 @@ describe('Router prefetch', () => { await didResolveAfterPrefetch() }) }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await nextBuild(appDir) appPort = await findPort() diff --git a/test/integration/router-rerender/test/index.test.js b/test/integration/router-rerender/test/index.test.js index 7985da9d65ca..e6cf27f3ec37 100644 --- a/test/integration/router-rerender/test/index.test.js +++ b/test/integration/router-rerender/test/index.test.js @@ -42,8 +42,7 @@ describe('router rerender', () => { runTests() }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await nextBuild(appDir) appPort = await findPort() diff --git a/test/integration/server-asset-modules/test/index.test.js b/test/integration/server-asset-modules/test/index.test.js index 3b7cb2e298eb..1b0046df833a 100644 --- a/test/integration/server-asset-modules/test/index.test.js +++ b/test/integration/server-asset-modules/test/index.test.js @@ -35,8 +35,7 @@ describe('serverside asset modules', () => { runTests() }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await nextBuild(appDir) diff --git a/test/integration/src-dir-support-double-dir/test/index.test.js b/test/integration/src-dir-support-double-dir/test/index.test.js index 58f055f15f63..00e4576fe96d 100644 --- a/test/integration/src-dir-support-double-dir/test/index.test.js +++ b/test/integration/src-dir-support-double-dir/test/index.test.js @@ -36,8 +36,7 @@ describe('Dynamic Routing', () => { runTests(true) }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await nextBuild(appDir) diff --git a/test/integration/src-dir-support/test/index.test.js b/test/integration/src-dir-support/test/index.test.js index f3f9cff5c5d9..ba2fc92fe3aa 100644 --- a/test/integration/src-dir-support/test/index.test.js +++ b/test/integration/src-dir-support/test/index.test.js @@ -85,8 +85,7 @@ describe('Dynamic Routing', () => { runTests(true) }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await nextBuild(appDir) appPort = await findPort() diff --git a/test/integration/ssg-data-404/test/index.test.js b/test/integration/ssg-data-404/test/index.test.js index 41d496b9def0..b4ac8dca60d3 100644 --- a/test/integration/ssg-data-404/test/index.test.js +++ b/test/integration/ssg-data-404/test/index.test.js @@ -81,8 +81,7 @@ describe('SSG data 404', () => { runTests() }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await nextBuild(appDir) diff --git a/test/integration/static-page-name/test/index.test.js b/test/integration/static-page-name/test/index.test.js index 6136db40fd07..98bcdf57f257 100644 --- a/test/integration/static-page-name/test/index.test.js +++ b/test/integration/static-page-name/test/index.test.js @@ -39,8 +39,7 @@ describe('Static Page Name', () => { afterAll(() => killApp(app)) runTests() }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { appPort = await findPort() await nextBuild(appDir) diff --git a/test/integration/styled-jsx-plugin/test/index.test.js b/test/integration/styled-jsx-plugin/test/index.test.js index 6492668aaec0..39476c4f7c0e 100644 --- a/test/integration/styled-jsx-plugin/test/index.test.js +++ b/test/integration/styled-jsx-plugin/test/index.test.js @@ -21,7 +21,7 @@ function runTests() { } describe('styled-jsx using in node_modules', () => { - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { const output = await nextBuild(appDir, undefined, { stdout: true, diff --git a/test/integration/trailing-slashes-href-resolving/test/index.test.js b/test/integration/trailing-slashes-href-resolving/test/index.test.js index 243c8736faa2..97fcf8bd8c20 100644 --- a/test/integration/trailing-slashes-href-resolving/test/index.test.js +++ b/test/integration/trailing-slashes-href-resolving/test/index.test.js @@ -102,8 +102,7 @@ describe('href resolving trailing-slash', () => { runTests(true) }) - - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { await nextBuild(appDir) appPort = await findPort() diff --git a/test/integration/trailing-slashes-rewrite/test/index.test.js b/test/integration/trailing-slashes-rewrite/test/index.test.js index 528ea9fcc32c..99e6ade4fb92 100644 --- a/test/integration/trailing-slashes-rewrite/test/index.test.js +++ b/test/integration/trailing-slashes-rewrite/test/index.test.js @@ -46,7 +46,7 @@ const runTests = () => { } describe('Trailing Slash Rewrite Proxying', () => { - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { proxyPort = await findPort() proxyServer = await initNextServerScript( diff --git a/test/integration/trailing-slashes/test/index.test.js b/test/integration/trailing-slashes/test/index.test.js index 602d869416a4..2dad5fd1d172 100644 --- a/test/integration/trailing-slashes/test/index.test.js +++ b/test/integration/trailing-slashes/test/index.test.js @@ -234,76 +234,81 @@ describe('Trailing slashes', () => { testWithTrailingSlash() }) - - describe('production mode, trailingSlash: false', () => { - beforeAll(async () => { - nextConfig.replace('// trailingSlash: boolean', 'trailingSlash: false') - await nextBuild(appDir) - appPort = await findPort() - app = await nextStart(appDir, appPort) - }) - afterAll(async () => { - nextConfig.restore() - await killApp(app) - }) - - testWithoutTrailingSlash() - - it('should have a redirect in the routesmanifest', async () => { - const manifest = await fs.readJSON( - join(appDir, '.next', 'routes-manifest.json') - ) - expect(manifest).toEqual( - expect.objectContaining({ - redirects: expect.arrayContaining([ - expect.objectContaining({ - source: '/:path+/', - destination: '/:path+', - statusCode: 308, - }), - ]), - }) - ) - }) - }) - - describe('production mode, trailingSlash: true', () => { - beforeAll(async () => { - nextConfig.replace('// trailingSlash: boolean', 'trailingSlash: true') - await nextBuild(appDir) - appPort = await findPort() - app = await nextStart(appDir, appPort) - }) - afterAll(async () => { - nextConfig.restore() - await killApp(app) - }) - - testWithTrailingSlash() - - it('should have a redirect in the routesmanifest', async () => { - const manifest = await fs.readJSON( - join(appDir, '.next', 'routes-manifest.json') - ) - expect(manifest).toEqual( - expect.objectContaining({ - redirects: expect.arrayContaining([ - expect.objectContaining({ - source: - '/:file((?!\\.well-known(?:/.*)?)(?:[^/]+/)*[^/]+\\.\\w+)/', - destination: '/:file', - statusCode: 308, - }), - expect.objectContaining({ - source: '/:notfile((?!\\.well-known(?:/.*)?)(?:[^/]+/)*[^/\\.]+)', - destination: '/:notfile/', - statusCode: 308, - }), - ]), - }) - ) - }) - }) + ;(process.env.TURBOPACK ? describe.skip : describe)( + 'production mode, trailingSlash: false', + () => { + beforeAll(async () => { + nextConfig.replace('// trailingSlash: boolean', 'trailingSlash: false') + await nextBuild(appDir) + appPort = await findPort() + app = await nextStart(appDir, appPort) + }) + afterAll(async () => { + nextConfig.restore() + await killApp(app) + }) + + testWithoutTrailingSlash() + + it('should have a redirect in the routesmanifest', async () => { + const manifest = await fs.readJSON( + join(appDir, '.next', 'routes-manifest.json') + ) + expect(manifest).toEqual( + expect.objectContaining({ + redirects: expect.arrayContaining([ + expect.objectContaining({ + source: '/:path+/', + destination: '/:path+', + statusCode: 308, + }), + ]), + }) + ) + }) + } + ) + ;(process.env.TURBOPACK ? describe.skip : describe)( + 'production mode, trailingSlash: true', + () => { + beforeAll(async () => { + nextConfig.replace('// trailingSlash: boolean', 'trailingSlash: true') + await nextBuild(appDir) + appPort = await findPort() + app = await nextStart(appDir, appPort) + }) + afterAll(async () => { + nextConfig.restore() + await killApp(app) + }) + + testWithTrailingSlash() + + it('should have a redirect in the routesmanifest', async () => { + const manifest = await fs.readJSON( + join(appDir, '.next', 'routes-manifest.json') + ) + expect(manifest).toEqual( + expect.objectContaining({ + redirects: expect.arrayContaining([ + expect.objectContaining({ + source: + '/:file((?!\\.well-known(?:/.*)?)(?:[^/]+/)*[^/]+\\.\\w+)/', + destination: '/:file', + statusCode: 308, + }), + expect.objectContaining({ + source: + '/:notfile((?!\\.well-known(?:/.*)?)(?:[^/]+/)*[^/\\.]+)', + destination: '/:notfile/', + statusCode: 308, + }), + ]), + }) + ) + }) + } + ) describe('dev mode, with basepath, trailingSlash: true', () => { beforeAll(async () => { @@ -329,30 +334,32 @@ describe('Trailing slashes', () => { ['/docs/linker?href=/', '/docs/'], ]) }) - - describe('production mode, with basepath, trailingSlash: true', () => { - beforeAll(async () => { - nextConfig.replace('// trailingSlash: boolean', 'trailingSlash: true') - nextConfig.replace('// basePath:', 'basePath:') - await nextBuild(appDir) - appPort = await findPort() - app = await nextStart(appDir, appPort) - }) - afterAll(async () => { - nextConfig.restore() - await killApp(app) - }) - - testShouldRedirect([ - ['/docs/about', '/docs/about/'], - ['/docs', '/docs/'], - ['/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/'], - ['/docs/linker?href=/', '/docs/'], - ]) - }) + ;(process.env.TURBOPACK ? describe.skip : describe)( + 'production mode, with basepath, trailingSlash: true', + () => { + beforeAll(async () => { + nextConfig.replace('// trailingSlash: boolean', 'trailingSlash: true') + nextConfig.replace('// basePath:', 'basePath:') + await nextBuild(appDir) + appPort = await findPort() + app = await nextStart(appDir, appPort) + }) + afterAll(async () => { + nextConfig.restore() + await killApp(app) + }) + + testShouldRedirect([ + ['/docs/about', '/docs/about/'], + ['/docs', '/docs/'], + ['/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/'], + ['/docs/linker?href=/', '/docs/'], + ]) + } + ) }) diff --git a/test/integration/typescript-only-remove-type-imports/test/index.test.js b/test/integration/typescript-only-remove-type-imports/test/index.test.js index 81ebc9d3b881..071046715448 100644 --- a/test/integration/typescript-only-remove-type-imports/test/index.test.js +++ b/test/integration/typescript-only-remove-type-imports/test/index.test.js @@ -28,7 +28,7 @@ const runTests = () => { } describe('TypeScript onlyRemoveTypeImports', () => { - describe('production mode', () => { + ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { const { code } = await nextBuild(appDir) if (code !== 0) throw new Error(`build failed with code ${code}`)