File tree 2 files changed +10
-2
lines changed
2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -569,7 +569,15 @@ export const createServer = async (
569
569
port : number ,
570
570
) : Promise < ReturnType < typeof express > > => {
571
571
const e = express ( ) ;
572
- await new Promise < void > ( ( r ) => e . listen ( port , r ) ) ;
572
+ const server = e . listen ( port , ( error ) => {
573
+ if ( error && error . code === 'EADDRINUSE' ) {
574
+ console . log ( `Port ${ port } is already in use. Trying a different port...` ) ;
575
+ } else if ( error ) {
576
+ console . error ( 'An error occurred:' , error ) ;
577
+ } else {
578
+ console . log ( `Server is listening on port ${ port } ` ) ;
579
+ }
580
+ } ) ;
573
581
return e ;
574
582
} ;
575
583
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ export default defineConfig({
30
30
timeout : 60000 ,
31
31
} ,
32
32
] ,
33
- reporter : [ [ "./reporter.ts" ] ] ,
33
+ // reporter: [["./reporter.ts"]],
34
34
use : {
35
35
baseURL : `http://localhost:${ port } ` ,
36
36
video : "retain-on-failure" ,
You can’t perform that action at this time.
0 commit comments