mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
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`.
67 lines
1.8 KiB
TypeScript
67 lines
1.8 KiB
TypeScript
import { nextTestSetup } from 'e2e-utils'
|
|
|
|
describe('no-mangling', () => {
|
|
describe('with the default `next build`', () => {
|
|
const { next } = nextTestSetup({
|
|
files: __dirname,
|
|
skipStart: true,
|
|
})
|
|
|
|
it('should show mangled function names in stack traces', async () => {
|
|
try {
|
|
await next.build()
|
|
} catch {
|
|
// we expect the build to fail
|
|
}
|
|
|
|
expect(next.cliOutput).toInclude(`
|
|
Error: Kaputt!
|
|
at `) // mangled function name omitted because it's not deterministic
|
|
|
|
// `Page` is the original function name that is mangled because `next
|
|
// build` was called without `--no-mangling`.
|
|
expect(next.cliOutput).not.toInclude(`
|
|
Error: Kaputt!
|
|
at Page`)
|
|
})
|
|
})
|
|
|
|
describe('with `next build --no-mangling`', () => {
|
|
const { next } = nextTestSetup({
|
|
files: __dirname,
|
|
buildArgs: ['--no-mangling'],
|
|
skipStart: true,
|
|
})
|
|
|
|
it('should show original function names in stack traces', async () => {
|
|
try {
|
|
await next.build()
|
|
} catch {
|
|
// we expect the build to fail
|
|
}
|
|
|
|
// `Page` is the original function name that would be mangled if `next
|
|
// build` was called without `--no-mangling`.
|
|
expect(next.cliOutput).toInclude(`
|
|
Error: Kaputt!
|
|
at Page`)
|
|
})
|
|
|
|
describe('with "use cache" functions', () => {
|
|
it('should show original function names in stack traces', async () => {
|
|
try {
|
|
await next.build()
|
|
} catch {
|
|
// we expect the build to fail
|
|
}
|
|
|
|
// `CachedPage` is the original function name that would be mangled if
|
|
// `next build` was called without `--no-mangling`.
|
|
expect(next.cliOutput).toInclude(`
|
|
Error: Kaputt!
|
|
at CachedPage`)
|
|
})
|
|
})
|
|
})
|
|
})
|