File tree Expand file tree Collapse file tree
packages/cli-doctor/src/tools/healthchecks/__tests__ Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -95,4 +95,24 @@ describe('androidStudio', () => {
9595
9696 platformSpy . mockRestore ( ) ;
9797 } ) ;
98+
99+ it ( 'detects when Android Studio is also not in fallback installation path' , async ( ) => {
100+ // Make CLI think Android Studio was not found
101+ environmentInfo . IDEs [ 'Android Studio' ] = 'Not Found' ;
102+ // Force the platform to win32 for the test
103+ const platformSpy = jest
104+ . spyOn ( process , 'platform' , 'get' )
105+ . mockReturnValue ( 'win32' ) ;
106+
107+ // First WMIC (primary) returns empty, second (fallback) returns version
108+ ( execa as jest . Mock )
109+ . mockResolvedValueOnce ( { stdout : '' } )
110+ . mockResolvedValueOnce ( { stdout : '' } ) ;
111+
112+ const diagnostics = await androidStudio . getDiagnostics ( environmentInfo ) ;
113+
114+ expect ( diagnostics . needsToBeFixed ) . toBe ( true ) ;
115+
116+ platformSpy . mockRestore ( ) ;
117+ } ) ;
98118} ) ;
You can’t perform that action at this time.
0 commit comments