File tree Expand file tree Collapse file tree 2 files changed +4
-21
lines changed
packages/cli-kit/src/public/node Expand file tree Collapse file tree 2 files changed +4
-21
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ describe('checkPortAvailability', () => {
8080
8181 // Then
8282 expect ( result ) . toBe ( true )
83- expect ( port . checkPort ) . toHaveBeenCalledWith ( portNumber , undefined )
83+ expect ( port . checkPort ) . toHaveBeenCalledWith ( portNumber , 'localhost' )
8484 } )
8585
8686 test ( 'returns false when port is not available' , async ( ) => {
@@ -93,23 +93,6 @@ describe('checkPortAvailability', () => {
9393
9494 // Then
9595 expect ( result ) . toBe ( false )
96- expect ( port . checkPort ) . toHaveBeenCalledWith ( portNumber , undefined )
97- } )
98-
99- test ( 'uses 0.0.0.0 as host when HOST env var is set' , async ( ) => {
100- // Given
101- const portNumber = 3000
102- vi . stubEnv ( 'HOST' , 'localhost' )
103- vi . mocked ( port . checkPort ) . mockResolvedValue ( portNumber )
104-
105- // When
106- const result = await checkPortAvailability ( portNumber )
107-
108- // Then
109- expect ( result ) . toBe ( true )
110- expect ( port . checkPort ) . toHaveBeenCalledWith ( portNumber , '0.0.0.0' )
111-
112- // Cleanup
113- vi . unstubAllEnvs ( )
96+ expect ( port . checkPort ) . toHaveBeenCalledWith ( portNumber , 'localhost' )
11497 } )
11598} )
Original file line number Diff line number Diff line change @@ -50,8 +50,8 @@ export async function checkPortAvailability(portNumber: number): Promise<boolean
5050
5151function host ( ) : string | undefined {
5252 // The get-port-please library does not work as expected when HOST env var is defined,
53- // so explicitly set the host to 0.0.0.0 to avoid conflicts
54- return process . env . HOST ? '0.0.0.0' : undefined
53+ // so explicitly set the host to localhost to avoid conflicts
54+ return 'localhost'
5555}
5656
5757/**
You can’t perform that action at this time.
0 commit comments