Unverified Commit 2f3842dd authored by Jamiboy Mohammad's avatar Jamiboy Mohammad Committed by GitHub

test: run the TypeScript version warning suites in deploy (#99195)

## Summary

Both suites assert on build output — one that `next build` warns about
TypeScript 4.0.6, the other that it stays quiet on a current version.
Deploy captures build output, so there is nothing here a deployment
cannot observe.

They were excluded by `skipDeployment` plus an `if (isNextDeploy ||
isNextDev)` return that reads as caution rather than a finding: no
incompatibility is recorded anywhere, and neither suite touches the
filesystem or the local CLI.

```diff
-  const { next, isNextDeploy, isNextDev, skipped } = nextTestSetup({
+  const { next, isNextDev } = nextTestSetup({
     files: __dirname,
     skipStart: true,
-    skipDeployment: true,
-  if (skipped) { return }
-  if (isNextDeploy || isNextDev) {
+  if (isNextDev) {
     it('should skip', () => {})
     return
   }
```

The `isNextDev` half of the guard is the part that holds — the warning
is emitted during a build, and there is no build in dev.

## The 240s timeout is not incidental

Each suite calls `next.start()` **inside the test body**, which
`e2e-utils` caps at 60 seconds when no explicit timeout is given.
Deployments now take about two minutes, so without this both would time
out on every run — the same failure #99162 had to fix in
`deprecation-warnings`.

## Verification

Run against real deployments in deploy mode with **webpack**, which is
the bundler PR CI does not cover:

```
PASS webpack  typescript-version-warning      57.7s  ✓
PASS webpack  typescript-version-no-warning   81.6s  ✓
```

Also green in start mode with Turbopack. ESLint and Prettier clean.

## Two suites I deliberately left out

These came from the same review of 19 suites that reported green in
~2.4s without running anything:

- **`url-imports`** is correctly excluded. It starts a local static
server on port 12345 and imports from it, so no deployment can reach its
source regardless of bundler. Its `skipDeployment` is load-bearing.
- **`webpack-loader-parse-error`** is already being enabled in #98850.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------
Co-authored-by: 's avatarClaude Opus 5 <noreply@anthropic.com>
parent 4562ce8c
import { nextTestSetup } from 'e2e-utils'
// @force-gate !dev
describe('typescript-version-no-warning', () => {
const { next, isNextDeploy, isNextDev, skipped } = nextTestSetup({
const { next } = nextTestSetup({
files: __dirname,
skipStart: true,
skipDeployment: true,
})
if (skipped) {
return
}
if (isNextDeploy || isNextDev) {
it('should skip', () => {})
return
}
it('should not print warning when new typescript version is used with next build', async () => {
await next.start().catch(() => {})
expect(next.cliOutput).not.toContain(
'Minimum recommended TypeScript version is'
)
})
}, 240_000)
})
import { nextTestSetup } from 'e2e-utils'
// @force-gate !dev
describe('typescript-version-warning', () => {
const { next, isNextDeploy, isNextDev, skipped } = nextTestSetup({
const { next } = nextTestSetup({
files: __dirname,
skipStart: true,
skipDeployment: true,
dependencies: {
typescript: '4.0.6',
},
})
if (skipped) {
return
}
if (isNextDeploy || isNextDev) {
it('should skip', () => {})
return
}
it('should print warning when old typescript version is used with next build', async () => {
await next.start().catch(() => {})
expect(next.cliOutput).toContain(
'Minimum recommended TypeScript version is v5.1.0, older versions can potentially be incompatible with Next.js. Detected: 4.0.6'
)
})
}, 240_000)
})
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