Unverified Commit 48fdf48e authored by Hendrik Liebau's avatar Hendrik Liebau Committed by GitHub

Apply `buildArgs` also for deploy tests (via `package.json`) (#88731)

This change ensures that the `buildArgs` specified in `nextTestSetup` are also applied when running deploy tests. This is achieved by modifying the build command in the `package.json` file used for deploy tests to include the specified `buildArgs`.

See also https://vercel.com/docs/builds/configure-a-build#build-command.

The only current e2e test that uses the `buildArgs` option is `test/e2e/react-compiler/react-compiler.test.ts`, but that one is excluded from deploy tests via `deploy-tests-manifest.json`.
parent 239471c8
...@@ -281,6 +281,9 @@ export class NextInstance { ...@@ -281,6 +281,9 @@ export class NextInstance {
...pkgScripts, ...pkgScripts,
build: build:
(pkgScripts['build'] || this.buildCommand || 'next build') + (pkgScripts['build'] || this.buildCommand || 'next build') +
(this.buildArgs?.length
? ` ${this.buildArgs.join(' ')}`
: '') +
' && pnpm post-build', ' && pnpm post-build',
}, },
}, },
......
...@@ -3,7 +3,6 @@ import path from 'path' ...@@ -3,7 +3,6 @@ import path from 'path'
const { version: nextVersion } = require('next/package.json') const { version: nextVersion } = require('next/package.json')
const cacheComponentsEnabled = process.env.__NEXT_CACHE_COMPONENTS === 'true' const cacheComponentsEnabled = process.env.__NEXT_CACHE_COMPONENTS === 'true'
const pprEnabled = process.env.__NEXT_EXPERIMENTAL_PPR === 'true' const pprEnabled = process.env.__NEXT_EXPERIMENTAL_PPR === 'true'
describe('build-output-prerender', () => { describe('build-output-prerender', () => {
......
...@@ -16,7 +16,7 @@ describe('no-mangling', () => { ...@@ -16,7 +16,7 @@ describe('no-mangling', () => {
expect(next.cliOutput).toInclude(` expect(next.cliOutput).toInclude(`
Error: Kaputt! Error: Kaputt!
at `) // mangled function name omitted because it's undeterministic at `) // mangled function name omitted because it's not deterministic
// `Page` is the original function name that is mangled because `next // `Page` is the original function name that is mangled because `next
// build` was called without `--no-mangling`. // build` was called without `--no-mangling`.
......
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