@@ -32,6 +32,10 @@ describe("build commands", () => {
3232 it ( "expects all output bundle files to be generated" , async ( ) => {
3333 const { generateBuildOutput, validateOutputDirectory } = await importUtils ;
3434 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" : "" ,
3539 ".next/standalone/server.js" : "" ,
3640 ".next/static/staticfile" : "" ,
3741 ".next/routes-manifest.json" : `{
@@ -53,7 +57,13 @@ describe("build commands", () => {
5357
5458 const expectedFiles = {
5559 ".next/standalone/.next/static/staticfile" : "" ,
60+ ".next/static/staticfile" : "" ,
5661 ".next/standalone/server.js" : "" ,
62+ ".next/routes-manifest.json" : `{
63+ "headers":[],
64+ "rewrites":[],
65+ "redirects":[]
66+ }` ,
5767 ".apphosting/bundle.yaml" : `version: v1
5868runConfig:
5969 runCommand: node .next/standalone/server.js
@@ -71,7 +81,7 @@ outputFiles:
7181 validateTestFiles ( tmpDir , expectedFiles ) ;
7282 } ) ;
7383
74- it ( "moves files into correct location in a monorepo setup" , async ( ) => {
84+ it ( "copies files into correct location in a monorepo setup" , async ( ) => {
7585 const { generateBuildOutput } = await importUtils ;
7686 const files = {
7787 ".next/standalone/apps/next-app/standalonefile" : "" ,
@@ -113,6 +123,7 @@ outputFiles:
113123 const expectedFiles = {
114124 ".next/standalone/apps/next-app/.next/static/staticfile" : "" ,
115125 ".next/standalone/apps/next-app/standalonefile" : "" ,
126+ ".next/static/staticfile" : "" ,
116127 } ;
117128 const expectedPartialYaml = {
118129 version : "v1" ,
@@ -125,6 +136,10 @@ outputFiles:
125136 it ( "test failed validateOutputDirectory" , async ( ) => {
126137 const { generateBuildOutput, validateOutputDirectory } = await importUtils ;
127138 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" : "" ,
128143 ".next/standalone/notserver.js" : "" ,
129144 ".next/static/staticfile" : "" ,
130145 ".next/routes-manifest.json" : `{
@@ -152,6 +167,10 @@ outputFiles:
152167 it ( "expects directories and other files to be copied over" , async ( ) => {
153168 const { generateBuildOutput, validateOutputDirectory } = await importUtils ;
154169 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" : "" ,
155174 ".next/standalone/server.js" : "" ,
156175 ".next/static/staticfile" : "" ,
157176 "public/publicfile" : "" ,
@@ -178,9 +197,15 @@ outputFiles:
178197
179198 const expectedFiles = {
180199 ".next/standalone/.next/static/staticfile" : "" ,
200+ ".next/static/staticfile" : "" ,
181201 ".next/standalone/server.js" : "" ,
182202 ".next/standalone/public/publicfile" : "" ,
183203 ".next/standalone/extrafile" : "" ,
204+ ".next/routes-manifest.json" : `{
205+ "headers":[],
206+ "rewrites":[],
207+ "redirects":[]
208+ }` ,
184209 } ;
185210 validateTestFiles ( tmpDir , expectedFiles ) ;
186211 } ) ;
0 commit comments