mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
Add /ide status & /ide install commands to manage IDE integration (#4265)
This commit is contained in:
@@ -153,6 +153,7 @@ describe('useSlashCommandProcessor', () => {
|
||||
getCheckpointingEnabled: vi.fn(() => true),
|
||||
getBugCommand: vi.fn(() => undefined),
|
||||
getSessionId: vi.fn(() => 'test-session-id'),
|
||||
getIdeMode: vi.fn(() => false),
|
||||
} as unknown as Config;
|
||||
mockCorgiMode = vi.fn();
|
||||
mockUseSessionStats.mockReturnValue({
|
||||
@@ -237,7 +238,10 @@ describe('useSlashCommandProcessor', () => {
|
||||
const mockLoader = async () => [newCommand];
|
||||
|
||||
// We create the instance outside the mock implementation.
|
||||
const commandServiceInstance = new ActualCommandService(mockLoader);
|
||||
const commandServiceInstance = new ActualCommandService(
|
||||
mockConfig,
|
||||
mockLoader,
|
||||
);
|
||||
|
||||
// This mock ensures the hook uses our pre-configured instance.
|
||||
vi.mocked(CommandService).mockImplementation(
|
||||
@@ -271,7 +275,10 @@ describe('useSlashCommandProcessor', () => {
|
||||
});
|
||||
const newCommand: SlashCommand = { name: 'test', action: mockAction };
|
||||
const mockLoader = async () => [newCommand];
|
||||
const commandServiceInstance = new ActualCommandService(mockLoader);
|
||||
const commandServiceInstance = new ActualCommandService(
|
||||
mockConfig,
|
||||
mockLoader,
|
||||
);
|
||||
vi.mocked(CommandService).mockImplementation(
|
||||
() => commandServiceInstance,
|
||||
);
|
||||
@@ -301,7 +308,10 @@ describe('useSlashCommandProcessor', () => {
|
||||
});
|
||||
const newCommand: SlashCommand = { name: 'test', action: mockAction };
|
||||
const mockLoader = async () => [newCommand];
|
||||
const commandServiceInstance = new ActualCommandService(mockLoader);
|
||||
const commandServiceInstance = new ActualCommandService(
|
||||
mockConfig,
|
||||
mockLoader,
|
||||
);
|
||||
vi.mocked(CommandService).mockImplementation(
|
||||
() => commandServiceInstance,
|
||||
);
|
||||
@@ -333,7 +343,10 @@ describe('useSlashCommandProcessor', () => {
|
||||
});
|
||||
const newCommand: SlashCommand = { name: 'test', action: mockAction };
|
||||
const mockLoader = async () => [newCommand];
|
||||
const commandServiceInstance = new ActualCommandService(mockLoader);
|
||||
const commandServiceInstance = new ActualCommandService(
|
||||
mockConfig,
|
||||
mockLoader,
|
||||
);
|
||||
vi.mocked(CommandService).mockImplementation(
|
||||
() => commandServiceInstance,
|
||||
);
|
||||
@@ -360,7 +373,10 @@ describe('useSlashCommandProcessor', () => {
|
||||
const newAuthCommand: SlashCommand = { name: 'auth', action: mockAction };
|
||||
|
||||
const mockLoader = async () => [newAuthCommand];
|
||||
const commandServiceInstance = new ActualCommandService(mockLoader);
|
||||
const commandServiceInstance = new ActualCommandService(
|
||||
mockConfig,
|
||||
mockLoader,
|
||||
);
|
||||
vi.mocked(CommandService).mockImplementation(
|
||||
() => commandServiceInstance,
|
||||
);
|
||||
@@ -386,7 +402,10 @@ describe('useSlashCommandProcessor', () => {
|
||||
});
|
||||
const newCommand: SlashCommand = { name: 'test', action: mockAction };
|
||||
const mockLoader = async () => [newCommand];
|
||||
const commandServiceInstance = new ActualCommandService(mockLoader);
|
||||
const commandServiceInstance = new ActualCommandService(
|
||||
mockConfig,
|
||||
mockLoader,
|
||||
);
|
||||
vi.mocked(CommandService).mockImplementation(
|
||||
() => commandServiceInstance,
|
||||
);
|
||||
@@ -414,7 +433,10 @@ describe('useSlashCommandProcessor', () => {
|
||||
};
|
||||
|
||||
const mockLoader = async () => [parentCommand];
|
||||
const commandServiceInstance = new ActualCommandService(mockLoader);
|
||||
const commandServiceInstance = new ActualCommandService(
|
||||
mockConfig,
|
||||
mockLoader,
|
||||
);
|
||||
vi.mocked(CommandService).mockImplementation(
|
||||
() => commandServiceInstance,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user