@@ -221,8 +221,8 @@ const customAppPageSuite = {
221221 expect ( indexFlight ) . toContain ( 'container-server' )
222222 } )
223223 } ,
224- before : ( ) => appServerPage . write ( rscAppPage ) ,
225- after : ( ) => appServerPage . delete ( ) ,
224+ beforeAll : ( ) => appServerPage . write ( rscAppPage ) ,
225+ afterAll : ( ) => appServerPage . delete ( ) ,
226226}
227227
228228runSuite ( 'Custom App' , 'dev' , customAppPageSuite )
@@ -267,8 +267,8 @@ describe('concurrentFeatures - dev', () => {
267267
268268const cssSuite = {
269269 runTests : css ,
270- before : ( ) => appPage . write ( appWithGlobalCss ) ,
271- after : ( ) => appPage . delete ( ) ,
270+ beforeAll : ( ) => appPage . write ( appWithGlobalCss ) ,
271+ afterAll : ( ) => appPage . delete ( ) ,
272272}
273273
274274runSuite ( 'CSS' , 'dev' , cssSuite )
@@ -286,8 +286,8 @@ const documentSuite = {
286286 )
287287 } )
288288 } ,
289- before : ( ) => documentPage . write ( documentWithGip ) ,
290- after : ( ) => documentPage . delete ( ) ,
289+ beforeAll : ( ) => documentPage . write ( documentWithGip ) ,
290+ afterAll : ( ) => documentPage . delete ( ) ,
291291}
292292
293293runSuite ( 'document' , 'dev' , documentSuite )
@@ -333,28 +333,29 @@ async function runBasicTests(context, env) {
333333 streaming ( context )
334334}
335335
336- function runSuite ( suiteName , env , { runTests , before , after } ) {
336+ function runSuite ( suiteName , env , options ) {
337337 const context = { appDir }
338338 describe ( `${ suiteName } ${ env } ` , ( ) => {
339339 if ( env === 'prod' ) {
340340 beforeAll ( async ( ) => {
341- before ?. ( )
341+ options . beforeAll ?. ( )
342342 context . appPort = await findPort ( )
343- context . server = await nextDev ( context . appDir , context . appPort )
343+ await nextBuild ( context . appDir )
344+ context . server = await nextStart ( context . appDir , context . appPort )
344345 } )
345346 }
346347 if ( env === 'dev' ) {
347348 beforeAll ( async ( ) => {
348- before ?. ( )
349+ options . beforeAll ?. ( )
349350 context . appPort = await findPort ( )
350351 context . server = await nextDev ( context . appDir , context . appPort )
351352 } )
352353 }
353354 afterAll ( async ( ) => {
354- after ?. ( )
355+ options . afterAll ?. ( )
355356 await killApp ( context . server )
356357 } )
357358
358- runTests ( context , env )
359+ options . runTests ( context , env )
359360 } )
360361}
0 commit comments