fix(cli): Shell autocomplete polish (#20411)

This commit is contained in:
Jacob Richman
2026-02-27 11:03:37 -08:00
committed by GitHub
parent b2cbf518e8
commit e00e8f4728
5 changed files with 183 additions and 87 deletions

View File

@@ -384,6 +384,10 @@ describe('useShellCompletion utilities', () => {
// Very basic sanity check: common commands should be found
if (process.platform !== 'win32') {
expect(results).toContain('ls');
} else {
expect(results).toContain('dir');
expect(results).toContain('cls');
expect(results).toContain('copy');
}
});
@@ -398,7 +402,12 @@ describe('useShellCompletion utilities', () => {
it('should handle empty PATH', async () => {
vi.stubEnv('PATH', '');
const results = await scanPathExecutables();
expect(results).toEqual([]);
if (process.platform === 'win32') {
expect(results.length).toBeGreaterThan(0);
expect(results).toContain('dir');
} else {
expect(results).toEqual([]);
}
vi.unstubAllEnvs();
});
});