@@ -30,7 +30,7 @@ describe('NetworkDetector', () => {
3030 end : jest . fn ( ) ,
3131 destroy : jest . fn ( ) ,
3232 } ;
33-
33+
3434 mockRequest . mockImplementation ( ( _options , callback ) => {
3535 callback ( { statusCode : 200 } ) ;
3636 return mockReq ;
@@ -50,7 +50,7 @@ describe('NetworkDetector', () => {
5050 end : jest . fn ( ) ,
5151 destroy : jest . fn ( ) ,
5252 } ;
53-
53+
5454 mockRequest . mockImplementation ( ( _options , callback ) => {
5555 callback ( { statusCode : 500 } ) ;
5656 return mockReq ;
@@ -74,7 +74,7 @@ describe('NetworkDetector', () => {
7474 end : jest . fn ( ) ,
7575 destroy : jest . fn ( ) ,
7676 } ;
77-
77+
7878 mockRequest . mockReturnValue ( mockReq ) ;
7979 mockFs . existsSync . mockReturnValue ( false ) ;
8080
@@ -92,7 +92,7 @@ describe('NetworkDetector', () => {
9292 ( mockFs . readJSON as jest . Mock ) . mockResolvedValue ( cachedData ) ;
9393
9494 const result = await NetworkDetector . hasConnectivity ( ) ;
95-
95+
9696 expect ( result ) . toBe ( true ) ; // Should return cached connectivity result
9797 expect ( mockRequest ) . not . toHaveBeenCalled ( ) ; // Should not make network request when cache is valid
9898 } ) ;
@@ -108,7 +108,7 @@ describe('NetworkDetector', () => {
108108 end : jest . fn ( ) ,
109109 destroy : jest . fn ( ) ,
110110 } ;
111-
111+
112112 mockRequest . mockImplementation ( ( _options , callback ) => {
113113 callback ( { statusCode : 200 } ) ;
114114 return mockReq ;
@@ -120,7 +120,7 @@ describe('NetworkDetector', () => {
120120 ( mockFs . writeJSON as jest . Mock ) . mockResolvedValue ( undefined ) ;
121121
122122 const result = await NetworkDetector . hasConnectivity ( ) ;
123-
123+
124124 expect ( result ) . toBe ( true ) ; // Should return fresh connectivity result
125125 expect ( mockRequest ) . toHaveBeenCalledTimes ( 1 ) ; // Should make network request when cache is expired
126126 } ) ;
@@ -131,7 +131,7 @@ describe('NetworkDetector', () => {
131131 end : jest . fn ( ) ,
132132 destroy : jest . fn ( ) ,
133133 } ;
134-
134+
135135 mockRequest . mockImplementation ( ( _options , callback ) => {
136136 callback ( { statusCode : 200 } ) ;
137137 return mockReq ;
@@ -141,7 +141,7 @@ describe('NetworkDetector', () => {
141141 ( mockFs . ensureFile as jest . Mock ) . mockRejectedValue ( new Error ( 'Disk full' ) ) ;
142142
143143 const result = await NetworkDetector . hasConnectivity ( ) ;
144-
144+
145145 expect ( result ) . toBe ( true ) ; // Should still return connectivity result despite cache save failure
146146 } ) ;
147147
@@ -151,7 +151,7 @@ describe('NetworkDetector', () => {
151151 end : jest . fn ( ) ,
152152 destroy : jest . fn ( ) ,
153153 } ;
154-
154+
155155 mockRequest . mockImplementation ( ( _options , callback ) => {
156156 callback ( { statusCode : 200 } ) ;
157157 return mockReq ;
@@ -163,7 +163,7 @@ describe('NetworkDetector', () => {
163163 ( mockFs . writeJSON as jest . Mock ) . mockResolvedValue ( undefined ) ;
164164
165165 const result = await NetworkDetector . hasConnectivity ( ) ;
166-
166+
167167 expect ( result ) . toBe ( true ) ; // Should still return connectivity result despite cache load failure
168168 } ) ;
169169} ) ;
0 commit comments