Skip to content

Commit e737f36

Browse files
committed
extra scenario double-check
1 parent b395715 commit e737f36

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

packages/cli-doctor/src/tools/healthchecks/__tests__/androidStudio.test.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff 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
});

0 commit comments

Comments
 (0)