chore: sync gemini-cli v0.1.19

This commit is contained in:
tanzhenxin 2025-08-18 19:55:46 +08:00
commit 7dbc240847
244 changed files with 19407 additions and 5030 deletions

View file

@ -93,13 +93,14 @@ describe('ideCommand', () => {
} as unknown as ReturnType<Config['getIdeClient']>);
});
it('should show connected status', () => {
it('should show connected status', async () => {
mockGetConnectionStatus.mockReturnValue({
status: core.IDEConnectionStatus.Connected,
});
const command = ideCommand(mockConfig);
const result = command!.subCommands!.find((c) => c.name === 'status')!
.action!(mockContext, '');
const result = await command!.subCommands!.find(
(c) => c.name === 'status',
)!.action!(mockContext, '');
expect(mockGetConnectionStatus).toHaveBeenCalled();
expect(result).toEqual({
type: 'message',
@ -108,13 +109,14 @@ describe('ideCommand', () => {
});
});
it('should show connecting status', () => {
it('should show connecting status', async () => {
mockGetConnectionStatus.mockReturnValue({
status: core.IDEConnectionStatus.Connecting,
});
const command = ideCommand(mockConfig);
const result = command!.subCommands!.find((c) => c.name === 'status')!
.action!(mockContext, '');
const result = await command!.subCommands!.find(
(c) => c.name === 'status',
)!.action!(mockContext, '');
expect(mockGetConnectionStatus).toHaveBeenCalled();
expect(result).toEqual({
type: 'message',
@ -122,13 +124,14 @@ describe('ideCommand', () => {
content: `🟡 Connecting...`,
});
});
it('should show disconnected status', () => {
it('should show disconnected status', async () => {
mockGetConnectionStatus.mockReturnValue({
status: core.IDEConnectionStatus.Disconnected,
});
const command = ideCommand(mockConfig);
const result = command!.subCommands!.find((c) => c.name === 'status')!
.action!(mockContext, '');
const result = await command!.subCommands!.find(
(c) => c.name === 'status',
)!.action!(mockContext, '');
expect(mockGetConnectionStatus).toHaveBeenCalled();
expect(result).toEqual({
type: 'message',
@ -137,15 +140,16 @@ describe('ideCommand', () => {
});
});
it('should show disconnected status with details', () => {
it('should show disconnected status with details', async () => {
const details = 'Something went wrong';
mockGetConnectionStatus.mockReturnValue({
status: core.IDEConnectionStatus.Disconnected,
details,
});
const command = ideCommand(mockConfig);
const result = command!.subCommands!.find((c) => c.name === 'status')!
.action!(mockContext, '');
const result = await command!.subCommands!.find(
(c) => c.name === 'status',
)!.action!(mockContext, '');
expect(mockGetConnectionStatus).toHaveBeenCalled();
expect(result).toEqual({
type: 'message',