@@ -32,6 +32,10 @@ describe("build commands", () => {
32
32
it ( "expects all output bundle files to be generated" , async ( ) => {
33
33
const { generateBuildOutput, validateOutputDirectory } = await importUtils ;
34
34
const files = {
35
+ // .next/standalone/.next/ must be created beforehand otherwise
36
+ // generateBuildOutput will attempt to copy
37
+ // .next/ into .next/standalone/.next
38
+ ".next/standalone/.next/package.json" : "" ,
35
39
".next/standalone/server.js" : "" ,
36
40
".next/static/staticfile" : "" ,
37
41
".next/routes-manifest.json" : `{
@@ -53,7 +57,13 @@ describe("build commands", () => {
53
57
54
58
const expectedFiles = {
55
59
".next/standalone/.next/static/staticfile" : "" ,
60
+ ".next/static/staticfile" : "" ,
56
61
".next/standalone/server.js" : "" ,
62
+ ".next/routes-manifest.json" : `{
63
+ "headers":[],
64
+ "rewrites":[],
65
+ "redirects":[]
66
+ }` ,
57
67
".apphosting/bundle.yaml" : `version: v1
58
68
runConfig:
59
69
runCommand: node .next/standalone/server.js
@@ -71,7 +81,7 @@ outputFiles:
71
81
validateTestFiles ( tmpDir , expectedFiles ) ;
72
82
} ) ;
73
83
74
- it ( "moves files into correct location in a monorepo setup" , async ( ) => {
84
+ it ( "copies files into correct location in a monorepo setup" , async ( ) => {
75
85
const { generateBuildOutput } = await importUtils ;
76
86
const files = {
77
87
".next/standalone/apps/next-app/standalonefile" : "" ,
@@ -113,6 +123,7 @@ outputFiles:
113
123
const expectedFiles = {
114
124
".next/standalone/apps/next-app/.next/static/staticfile" : "" ,
115
125
".next/standalone/apps/next-app/standalonefile" : "" ,
126
+ ".next/static/staticfile" : "" ,
116
127
} ;
117
128
const expectedPartialYaml = {
118
129
version : "v1" ,
@@ -125,6 +136,10 @@ outputFiles:
125
136
it ( "test failed validateOutputDirectory" , async ( ) => {
126
137
const { generateBuildOutput, validateOutputDirectory } = await importUtils ;
127
138
const files = {
139
+ // .next/standalone/.next/ must be created beforehand otherwise
140
+ // generateBuildOutput will attempt to copy
141
+ // .next/ into .next/standalone/.next
142
+ ".next/standalone/.next/package.json" : "" ,
128
143
".next/standalone/notserver.js" : "" ,
129
144
".next/static/staticfile" : "" ,
130
145
".next/routes-manifest.json" : `{
@@ -152,6 +167,10 @@ outputFiles:
152
167
it ( "expects directories and other files to be copied over" , async ( ) => {
153
168
const { generateBuildOutput, validateOutputDirectory } = await importUtils ;
154
169
const files = {
170
+ // .next/standalone/.next/ must be created beforehand otherwise
171
+ // generateBuildOutput will attempt to copy
172
+ // .next/ into .next/standalone/.next
173
+ ".next/standalone/.next/package.json" : "" ,
155
174
".next/standalone/server.js" : "" ,
156
175
".next/static/staticfile" : "" ,
157
176
"public/publicfile" : "" ,
@@ -178,9 +197,15 @@ outputFiles:
178
197
179
198
const expectedFiles = {
180
199
".next/standalone/.next/static/staticfile" : "" ,
200
+ ".next/static/staticfile" : "" ,
181
201
".next/standalone/server.js" : "" ,
182
202
".next/standalone/public/publicfile" : "" ,
183
203
".next/standalone/extrafile" : "" ,
204
+ ".next/routes-manifest.json" : `{
205
+ "headers":[],
206
+ "rewrites":[],
207
+ "redirects":[]
208
+ }` ,
184
209
} ;
185
210
validateTestFiles ( tmpDir , expectedFiles ) ;
186
211
} ) ;
0 commit comments