Unverified Commit 09b98c73 authored by Jamiboy Mohammad's avatar Jamiboy Mohammad Committed by GitHub

test: remove redundant deployment skips from mode-guarded suites (#98908)

## Summary

Remove 28 redundant `skipDeployment` options across 16 e2e test files
whose existing mode guards already exclude deploy. Preserve the original
tests, fixtures, assertions, and outer mode guards. Remove the redundant
inner deploy return in Custom routes export so Jest still registers its
skipped test instead of rejecting an empty suite with setup hooks.

This includes the loader-file error suite: its dev and local build/start
sections have no enabled descendant tests in deploy mode, so Jest does
not run their enclosing setup hooks. Removing these options does not
enable new deployment coverage.

Stacks on #98842, which contains the whole-suite moves.

## Verification

- Verified the 28 option removals; the custom-routes collection fix
additionally removes the redundant inner return and unused destructured
mode flag.
- A focused Jest Circus reproduction using the affected describe block
reproduced both empty-suite hook errors before the fix; afterward it
collected one skipped test, ran no setup or teardown hooks, and reported
no errors.
- Formatting, ESLint, and whitespace checks passed for the constituent
changes.
- Verified with Jest Circus that an outer `beforeAll` does not execute
when all descendant tests are skipped.
- Runtime tests were not rerun locally for this fold; CI runs on the
updated branch.

<!-- NEXT_JS_LLM -->
parent bf53f53c
......@@ -136,7 +136,6 @@ describe('404 Page Support', () => {
const { next, skipped } = nextTestSetup({
files: __dirname,
skipStart: true,
skipDeployment: true,
})
if (skipped) return
......
......@@ -1331,7 +1331,6 @@ describe('instant-navigation-testing-api - blocking routes (dev only)', () => {
const { next } = nextTestSetup({
files: join(__dirname, 'fixtures', 'blocking'),
skipDeployment: true,
})
// The cookie value must not commit while the instant lock is held; it only
......
......@@ -12,7 +12,6 @@ async function testDev(browser, errorRegex) {
describe('Error test if the loader file export a named function', () => {
describe('in Development', () => {
const { next, isNextDev } = nextTestSetup({
skipDeployment: true,
files: __dirname,
})
......@@ -31,7 +30,6 @@ describe('Error test if the loader file export a named function', () => {
describe('in Build and Start', () => {
const { next, isNextStart } = nextTestSetup({
skipDeployment: true,
skipStart: true,
files: __dirname,
})
......
......@@ -3654,12 +3654,10 @@ describe('Custom routes solo types', () => {
})
})
;(isNextStart ? describe : describe.skip)('Custom routes export', () => {
const { next, isNextDeploy } = nextTestSetup({
const { next } = nextTestSetup({
files: __dirname,
skipStart: true,
skipDeployment: true,
})
if (isNextDeploy) return
it('should not show warning for custom routes when not next export', async () => {
await next.patchFile('next.config.js', (content) =>
......
......@@ -207,7 +207,6 @@ describe.each([
serverReadyPattern: /- Local:/,
env: { USE_HTTPS: useHttps, NODE_ENV: sharedNodeEnv },
dependencies: sharedDeps,
skipDeployment: true,
disableAutoSkewProtection: true,
})
if (skipped) return
......
......@@ -9,7 +9,6 @@ describe('GS(S)P Page Errors', () => {
;(isNextDev ? describe : describe.skip)('development mode', () => {
const { next, skipped } = nextTestSetup({
files: __dirname,
skipDeployment: true,
})
if (skipped) return
......@@ -107,7 +106,6 @@ describe('GS(S)P Page Errors', () => {
const { next, skipped } = nextTestSetup({
files: __dirname,
skipStart: true,
skipDeployment: true,
})
if (skipped) return
......
......@@ -31,7 +31,6 @@ if (isNextStart) {
const { next, skipped } = nextTestSetup({
files: __dirname,
skipStart: true,
skipDeployment: true,
})
if (skipped) return
......
......@@ -17,7 +17,6 @@ describe('Edge runtime configurable guards', () => {
;(isNextDev ? describe : describe.skip)('development mode', () => {
const { next, isTurbopack, skipped } = nextTestSetup({
files: __dirname,
skipDeployment: true,
})
if (skipped) return
......@@ -346,7 +345,6 @@ describe('Edge runtime configurable guards', () => {
files: __dirname,
skipStart: true,
env: shouldUseTurbopack() ? {} : { NEXT_TELEMETRY_DEBUG: '1' },
skipDeployment: true,
})
if (skipped) return
......
......@@ -126,7 +126,6 @@ describe('Edge runtime module errors', () => {
// pushes the initial server startup past the default 10s window on
// loaded CI hardware.
startServerTimeout: 30_000,
skipDeployment: true,
})
if (skipped) return
......@@ -581,7 +580,6 @@ describe('Edge runtime module errors', () => {
dependencies: {
nanoid: 'latest',
},
skipDeployment: true,
})
if (skipped) return
......
......@@ -286,7 +286,6 @@ describe('Image Optimizer', () => {
const size = 96
const { next, skipped } = nextTestSetup({
files: join(__dirname, 'app'),
skipDeployment: true,
})
if (skipped) return
......@@ -378,7 +377,6 @@ describe('Image Optimizer', () => {
path: 'https://example.com/act123/',
},
},
skipDeployment: true,
})
if (skipped) return
......@@ -402,7 +400,6 @@ describe('Image Optimizer', () => {
nextConfig: {
images: { unoptimized: true },
},
skipDeployment: true,
})
if (skipped) return
......@@ -426,7 +423,6 @@ describe('Image Optimizer', () => {
nextConfig: {
experimental: { imgOptMaxInputPixels: 100 },
},
skipDeployment: true,
})
if (skipped) return
......@@ -459,7 +455,6 @@ describe('Image Optimizer', () => {
]
},
},
skipDeployment: true,
})
if (skipped) return
......@@ -513,7 +508,6 @@ describe('Image Optimizer', () => {
imageSizes: [],
},
},
skipDeployment: true,
})
if (skipped) return
......
......@@ -47,7 +47,6 @@ describe('TypeScript Image Component Dev', () => {
const { next } = nextTestSetup({
files: __dirname,
skipDeployment: true,
})
it('should have image types when enabled', async () => {
......
......@@ -1687,7 +1687,6 @@ if (isNextStart) {
let collector: Collector | undefined
const { next, skipped } = nextTestSetup({
files: __dirname,
skipDeployment: true,
skipStart: true,
dependencies: require('./package.json').dependencies,
startCommand: 'pnpm start-entrypoint',
......@@ -2387,7 +2386,6 @@ if (isNextStart) {
describe('opentelemetry with direct entrypoint handler', () => {
const { next, skipped } = nextTestSetup({
files: __dirname,
skipDeployment: true,
skipStart: true,
dependencies: require('./package.json').dependencies,
startCommand: 'pnpm start-entrypoint',
......
......@@ -434,7 +434,6 @@ describe('404 handling', () => {
const { next, skipped } = nextTestSetup({
files: path.join(__dirname, 'app'),
skipStart: true,
skipDeployment: true,
})
if (skipped) return
......@@ -508,7 +507,6 @@ describe('404 handling', () => {
const { next, skipped } = nextTestSetup({
files: path.join(__dirname, 'app'),
skipStart: true,
skipDeployment: true,
})
if (skipped) return
......
......@@ -18,7 +18,6 @@ describe('swcPlugins', () => {
;(isNextDev ? describe : describe.skip)('incompatible plugin version', () => {
const { next, skipped, isTurbopack } = nextTestSetup({
files: __dirname,
skipDeployment: true,
dependencies: {
'@swc/plugin-react-remove-properties': '7.0.2',
},
......@@ -56,7 +55,6 @@ describe('swcPlugins', () => {
;(isNextDev ? describe : describe.skip)('invalid plugin name', () => {
const { next, skipped, isTurbopack } = nextTestSetup({
files: __dirname,
skipDeployment: true,
overrideFiles: {
'next.config.js': `
module.exports = {
......
......@@ -120,7 +120,6 @@ describe('turbopack-trace-server', () => {
const { next, isTurbopack, isNextDev, skipped } = nextTestSetup({
files: __dirname,
env: { NEXT_TURBOPACK_TRACING: '1' },
skipDeployment: true,
})
if (skipped) return
......
......@@ -105,7 +105,6 @@ export default function EvilPage(): JSX.Element {
dependencies: {
sass: 'latest',
},
skipDeployment: true,
})
if (skipped) return
......
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