@@ -310,9 +310,10 @@ describe('test/start.test.js', () => {
310310
311311 describe ( 'read cluster config' , ( ) => {
312312 let app ;
313- const fixturePath = path . join ( __dirname , 'fixtures/cluster-config' ) ;
313+ let fixturePath ;
314314
315315 before ( function * ( ) {
316+ fixturePath = path . join ( __dirname , 'fixtures/cluster-config' ) ;
316317 yield utils . cleanup ( fixturePath ) ;
317318 } ) ;
318319
@@ -366,9 +367,10 @@ describe('test/start.test.js', () => {
366367
367368 describe ( 'auto set custom node dir to PATH' , ( ) => {
368369 let app ;
369- const fixturePath = path . join ( __dirname , 'fixtures/custom-node-dir' ) ;
370+ let fixturePath ;
370371
371372 before ( function * ( ) {
373+ fixturePath = path . join ( __dirname , 'fixtures/custom-node-dir' ) ;
372374 yield utils . cleanup ( fixturePath ) ;
373375 } ) ;
374376
@@ -382,16 +384,16 @@ describe('test/start.test.js', () => {
382384 path . join ( fixturePath , 'node_modules/.bin' ) ,
383385 path . join ( fixturePath , '.node/bin' ) ,
384386 ] . join ( path . delimiter ) + path . delimiter ;
385- app = coffee . fork ( eggBin , [ 'start' , '--workers=2' , fixturePath ] ) ;
386- app . debug ( ) ;
387+ app = coffee . fork ( eggBin , [ 'start' , '--workers=2' , '--port=7002' , fixturePath ] ) ;
388+ // app.debug();
387389 app . expect ( 'code' , 0 ) ;
388390
389391 yield sleep ( waitTime ) ;
390392
391393 assert ( app . stderr === '' ) ;
392- assert ( app . stdout . match ( / e g g s t a r t e d o n h t t p : \/ \/ 1 2 7 \. 0 \. 0 \. 1 : 7 0 0 1 / ) ) ;
394+ assert ( app . stdout . match ( / e g g s t a r t e d o n h t t p : \/ \/ 1 2 7 \. 0 \. 0 \. 1 : 7 0 0 2 / ) ) ;
393395 assert ( ! app . stdout . includes ( 'app_worker#3:' ) ) ;
394- const result = yield httpclient . request ( 'http://127.0.0.1:7001 ' ) ;
396+ const result = yield httpclient . request ( 'http://127.0.0.1:7002 ' ) ;
395397 assert ( result . data . toString ( ) . startsWith ( `hi, ${ expectPATH } ` ) ) ;
396398 } ) ;
397399 } ) ;
@@ -408,7 +410,7 @@ describe('test/start.test.js', () => {
408410 } ) ;
409411 afterEach ( function * ( ) {
410412 yield coffee . fork ( eggBin , [ 'stop' , cwd ] )
411- . debug ( )
413+ // .debug()
412414 . end ( ) ;
413415 yield utils . cleanup ( cwd ) ;
414416 } ) ;
@@ -440,7 +442,7 @@ describe('test/start.test.js', () => {
440442 it ( 'should start default egg' , function * ( ) {
441443 cwd = path . join ( __dirname , 'fixtures/egg-app' ) ;
442444 yield coffee . fork ( eggBin , [ 'start' , '--daemon' , '--workers=2' , cwd ] )
443- . debug ( )
445+ // .debug()
444446 . expect ( 'stdout' , / S t a r t i n g e g g a p p l i c a t i o n / )
445447 . expect ( 'stdout' , / e g g s t a r t e d o n h t t p : \/ \/ 1 2 7 \. 0 \. 0 \. 1 : 7 0 0 1 / )
446448 . expect ( 'code' , 0 )
0 commit comments