@@ -38,7 +38,7 @@ describe('test serve', () => {
38
38
useProxy : true ,
39
39
notifyOnConsoleLog : false
40
40
} ;
41
- spyOn ( network , 'findClosestOpenPort ' ) . and . callFake ( ( host : string , port : number ) => Promise . resolve ( port ) ) ;
41
+ spyOn ( network , 'findClosestOpenPorts ' ) . and . callFake ( ( host : string , ports : number [ ] ) => Promise . resolve ( ports ) ) ;
42
42
spyOn ( notificationServer , 'createNotificationServer' ) ;
43
43
spyOn ( liveReloadServer , 'createLiveReloadServer' ) ;
44
44
spyOn ( httpServer , 'createHttpServer' ) ;
@@ -48,7 +48,7 @@ describe('test serve', () => {
48
48
49
49
it ( 'should work with no args on a happy path' , ( ) => {
50
50
return serve . serve ( context ) . then ( ( ) => {
51
- expect ( network . findClosestOpenPort ) . toHaveBeenCalledWith ( '0.0.0.0' , 53703 ) ;
51
+ expect ( network . findClosestOpenPorts ) . toHaveBeenCalledWith ( '0.0.0.0' , [ 53703 , 35729 , 8100 ] ) ;
52
52
expect ( notificationServer . createNotificationServer ) . toHaveBeenCalledWith ( configResults ) ;
53
53
expect ( liveReloadServer . createLiveReloadServer ) . toHaveBeenCalledWith ( configResults ) ;
54
54
expect ( httpServer . createHttpServer ) . toHaveBeenCalledWith ( configResults ) ;
@@ -61,7 +61,7 @@ describe('test serve', () => {
61
61
config . addArgv ( 'android' ) ;
62
62
63
63
return serve . serve ( context ) . then ( ( ) => {
64
- expect ( network . findClosestOpenPort ) . toHaveBeenCalledWith ( '0.0.0.0' , 53703 ) ;
64
+ expect ( network . findClosestOpenPorts ) . toHaveBeenCalledWith ( '0.0.0.0' , [ 53703 , 35729 , 8100 ] ) ;
65
65
expect ( notificationServer . createNotificationServer ) . toHaveBeenCalledWith ( configResults ) ;
66
66
expect ( liveReloadServer . createLiveReloadServer ) . toHaveBeenCalledWith ( configResults ) ;
67
67
expect ( httpServer . createHttpServer ) . toHaveBeenCalledWith ( configResults ) ;
@@ -92,14 +92,14 @@ describe('test serve', () => {
92
92
configResults . host = '127.0.0.1' ;
93
93
configResults . hostBaseUrl = 'http://127.0.0.1:8101' ;
94
94
config . addArgv ( '--livereload-port' ) ;
95
- config . addArgv ( '35729 ' ) ;
96
- configResults . liveReloadPort = 35729 ;
95
+ config . addArgv ( '35730 ' ) ;
96
+ configResults . liveReloadPort = 35730 ;
97
97
config . addArgv ( '--dev-logger-port' ) ;
98
- config . addArgv ( '53703 ' ) ;
99
- configResults . notificationPort = 53703 ;
98
+ config . addArgv ( '53704 ' ) ;
99
+ configResults . notificationPort = 53704 ;
100
100
101
101
return serve . serve ( context ) . then ( ( ) => {
102
- expect ( network . findClosestOpenPort ) . toHaveBeenCalledWith ( '127.0.0.1' , 53703 ) ;
102
+ expect ( network . findClosestOpenPorts ) . toHaveBeenCalledWith ( '127.0.0.1' , [ 53704 , 35730 , 8101 ] ) ;
103
103
expect ( notificationServer . createNotificationServer ) . toHaveBeenCalledWith ( configResults ) ;
104
104
expect ( liveReloadServer . createLiveReloadServer ) . toHaveBeenCalledWith ( configResults ) ;
105
105
expect ( httpServer . createHttpServer ) . toHaveBeenCalledWith ( configResults ) ;
0 commit comments