@@ -24,18 +24,26 @@ async function waitForReady(child, expectedResponse) {
2424}
2525
2626async function waitNuxt ( nuxtProcess ) {
27+ nuxtProcess . stderr . on ( "data" , ( data ) => {
28+ console . log ( "Nuxt STDERR:" , data . toString ( ) . trim ( ) ) ;
29+ } ) ;
30+ nuxtProcess . on ( "close" , ( code ) => {
31+ console . log ( `Nuxt process closed with code ${ code } ` ) ;
32+ } ) ;
33+
2734 for await ( const [ data ] of on ( nuxtProcess . stdout , "data" ) ) {
2835 const output = data . toString ( ) ;
29- console . log ( "Nuxt:" , output ) ;
36+ console . log ( "Nuxt STDOUT :" , output . trim ( ) ) ;
3037 const portMatch = output . match ( / L i s t e n i n g o n h t t p : \/ \/ \[ : : \] : (?< port > \d + ) / u) ;
3138 if ( portMatch ) {
32- const [ , nuxtPort ] = portMatch ;
33-
34- console . log ( "Nuxt listening on port" , nuxtPort ) ;
35- return nuxtPort ;
39+ console . log ( "Nuxt listening on port" , portMatch . groups . port ) ;
40+ nuxtProcess . stdout . on ( "data" , ( newData ) => {
41+ console . log ( "Nuxt STDOUT:" , newData . toString ( ) . trim ( ) ) ;
42+ } ) ;
43+ return portMatch . groups . port ;
3644 }
3745 }
38- throw new Error ( "Nuxt process closed without accepting connections " ) ;
46+ throw new Error ( "Nuxt process closed" ) ;
3947}
4048
4149async function runBrowser ( scriptName ) {
0 commit comments