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

Fix deploy test TypeScript exclusions (#96545)

## Summary

Set `NEXT_PRIVATE_LOCAL_DEV=1` for directory fixtures in deploy mode,
matching the next-start setup. This keeps copied test runner files
excluded from TypeScript checks when deployment tests use
`tsconfig.test.json`.

## Verification

- `pnpm exec tsc --project test/lib/tsconfig.json --noEmit`
- Not run: deployment tests (requires Vercel deployment credentials)

<!-- NEXT_JS_LLM -->
parent 8a4920c1
...@@ -2,10 +2,11 @@ import os from 'os' ...@@ -2,10 +2,11 @@ import os from 'os'
import path from 'path' import path from 'path'
import execa from 'execa' import execa from 'execa'
import fs from 'fs-extra' import fs from 'fs-extra'
import { NextInstance } from './base' import { NextInstance, type NextInstanceOpts } from './base'
import * as projectEnv from '../../../scripts/reset-project.mjs' import * as projectEnv from '../../../scripts/reset-project.mjs'
import { Span } from 'next/dist/trace' import { Span } from 'next/dist/trace'
import { setTimeout } from 'timers/promises' import { setTimeout } from 'timers/promises'
import { FileRef } from '../e2e-utils'
export class NextDeployInstance extends NextInstance { export class NextDeployInstance extends NextInstance {
private _cliOutput: string private _cliOutput: string
...@@ -14,6 +15,17 @@ export class NextDeployInstance extends NextInstance { ...@@ -14,6 +15,17 @@ export class NextDeployInstance extends NextInstance {
private _supportsImmutableAssets: boolean = false private _supportsImmutableAssets: boolean = false
private _writtenHostsLine: string | null = null private _writtenHostsLine: string | null = null
constructor(opts: NextInstanceOpts) {
super(opts)
if (typeof opts.files === 'string' || opts.files instanceof FileRef) {
this.env = {
NEXT_PRIVATE_LOCAL_DEV: '1',
...this.env,
}
}
}
protected throwIfUnavailable(): void | never { protected throwIfUnavailable(): void | never {
if (this.isStopping !== null) { if (this.isStopping !== null) {
throw new Error('Next.js is no longer available.', { throw new Error('Next.js is no longer available.', {
......
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