File size: 4,469 Bytes
4514571 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | diff --git a/test/production/app-dir/browser-chunks/browser-chunks.test.ts b/test/production/app-dir/browser-chunks/browser-chunks.test.ts
index 041a813ad0..ecf810fcb3 100644
--- a/test/production/app-dir/browser-chunks/browser-chunks.test.ts
+++ b/test/production/app-dir/browser-chunks/browser-chunks.test.ts
@@ -22,6 +22,14 @@ function normalizeSource(source: string): string {
describe('browser-chunks', () => {
const { next } = nextTestSetup({
files: __dirname,
+ dependencies: {
+ react: '19.2.7',
+ 'react-dom': '19.2.7',
+ '@types/react': '19.2.2',
+ '@types/react-dom': '19.2.1',
+ typescript: '6.0.2',
+ '@types/node': '20.17.6',
+ },
})
let sources: string[] = []
@@ -45,13 +53,11 @@ describe('browser-chunks', () => {
)
})
- // These snapshots document which matching modules currently reach browser
- // chunks. Some of these we don't intend to act on yet, so we snapshot the
- // normalized paths (rather than hard-fail) to surface regressions on review.
it('must not bundle any server modules into browser chunks', () => {
const serverSources = Array.from(
new Set(
sources
+ // normalizing in case we regress and want to keep track of the regression
.map(normalizeSource)
.filter(
(source) =>
@@ -63,46 +69,7 @@ describe('browser-chunks', () => {
)
).sort()
- // This set varies along two axes, so snapshot each combination separately
- // rather than forcing them to agree:
- // - bundler: webpack's browser chunks contain none of these; Turbopack
- // still pulls in a set we haven't acted on yet.
- // - cache components: enabling it pulls additional server modules
- // (instant-validation, async storage, dynamic rendering) into the
- // client render path. CI runs this suite both with and without it
- // (see test/cache-components-tests-manifest.json).
- const cacheComponents = process.env.__NEXT_CACHE_COMPONENTS === 'true'
- if (process.env.IS_TURBOPACK_TEST) {
- if (cacheComponents) {
- expect(serverSources).toMatchInlineSnapshot(`
- [
- "src/server/app-render/async-local-storage.ts",
- "src/server/app-render/instant-validation/boundary-constants.ts",
- "src/server/app-render/instant-validation/boundary-impl.tsx",
- "src/server/app-render/instant-validation/instant-samples-client.ts",
- "src/server/app-render/instant-validation/instant-samples.ts",
- "src/server/app-render/instant-validation/instant-validation-error.ts",
- "src/server/app-render/staged-rendering.ts",
- "src/server/app-render/work-async-storage-instance.ts",
- "src/server/app-render/work-async-storage.external.ts",
- "src/server/app-render/work-unit-async-storage-instance.ts",
- "src/server/app-render/work-unit-async-storage.external.ts",
- "src/server/web/spec-extension/adapters/headers.ts",
- "src/server/web/spec-extension/adapters/reflect.ts",
- "src/server/web/spec-extension/adapters/request-cookies.ts",
- "src/server/web/spec-extension/cookies.ts",
- ]
- `)
- } else {
- expect(serverSources).toMatchInlineSnapshot(`[]`)
- }
- } else {
- if (cacheComponents) {
- expect(serverSources).toMatchInlineSnapshot(`[]`)
- } else {
- expect(serverSources).toMatchInlineSnapshot(`[]`)
- }
- }
+ expect(serverSources).toEqual([])
})
it('must not bundle any dev overlay into browser chunks', () => {
diff --git a/test/production/app-dir/browser-chunks/browser-runtime.test.ts b/test/production/app-dir/browser-chunks/browser-runtime.test.ts
new file mode 100644
index 0000000000..1891353f1f
--- /dev/null
+++ b/test/production/app-dir/browser-chunks/browser-runtime.test.ts
@@ -0,0 +1,21 @@
+import { nextTestSetup } from 'e2e-utils'
+
+describe('browser runtime', () => {
+ const { next } = nextTestSetup({
+ files: __dirname,
+ dependencies: {
+ react: '19.2.7',
+ 'react-dom': '19.2.7',
+ '@types/react': '19.2.2',
+ '@types/react-dom': '19.2.1',
+ typescript: '6.0.2',
+ '@types/node': '20.17.6',
+ },
+ })
+
+ it('serves the client application in production', async () => {
+ const response = await next.fetch('/')
+
+ expect(response.status).toBe(200)
+ })
+})
|