mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-21 09:17:53 +00:00
Move MCP slash command to new system (#3678)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Abhi <abhipatel@google.com>
This commit is contained in:
@@ -18,6 +18,7 @@ import { privacyCommand } from '../ui/commands/privacyCommand.js';
|
||||
import { aboutCommand } from '../ui/commands/aboutCommand.js';
|
||||
import { compressCommand } from '../ui/commands/compressCommand.js';
|
||||
import { extensionsCommand } from '../ui/commands/extensionsCommand.js';
|
||||
import { mcpCommand } from '../ui/commands/mcpCommand.js';
|
||||
|
||||
// Mock the command modules to isolate the service from the command implementations.
|
||||
vi.mock('../ui/commands/memoryCommand.js', () => ({
|
||||
@@ -50,9 +51,12 @@ vi.mock('../ui/commands/compressCommand.js', () => ({
|
||||
vi.mock('../ui/commands/extensionsCommand.js', () => ({
|
||||
extensionsCommand: { name: 'extensions', description: 'Mock Extensions' },
|
||||
}));
|
||||
vi.mock('../ui/commands/mcpCommand.js', () => ({
|
||||
mcpCommand: { name: 'mcp', description: 'Mock MCP' },
|
||||
}));
|
||||
|
||||
describe('CommandService', () => {
|
||||
const subCommandLen = 11;
|
||||
const subCommandLen = 12;
|
||||
|
||||
describe('when using default production loader', () => {
|
||||
let commandService: CommandService;
|
||||
@@ -91,6 +95,7 @@ describe('CommandService', () => {
|
||||
expect(commandNames).toContain('about');
|
||||
expect(commandNames).toContain('compress');
|
||||
expect(commandNames).toContain('extensions');
|
||||
expect(commandNames).toContain('mcp');
|
||||
});
|
||||
|
||||
it('should overwrite any existing commands when called again', async () => {
|
||||
@@ -124,6 +129,7 @@ describe('CommandService', () => {
|
||||
compressCommand,
|
||||
extensionsCommand,
|
||||
helpCommand,
|
||||
mcpCommand,
|
||||
memoryCommand,
|
||||
privacyCommand,
|
||||
statsCommand,
|
||||
|
||||
@@ -8,6 +8,7 @@ import { SlashCommand } from '../ui/commands/types.js';
|
||||
import { memoryCommand } from '../ui/commands/memoryCommand.js';
|
||||
import { helpCommand } from '../ui/commands/helpCommand.js';
|
||||
import { clearCommand } from '../ui/commands/clearCommand.js';
|
||||
import { mcpCommand } from '../ui/commands/mcpCommand.js';
|
||||
import { authCommand } from '../ui/commands/authCommand.js';
|
||||
import { themeCommand } from '../ui/commands/themeCommand.js';
|
||||
import { chatCommand } from '../ui/commands/chatCommand.js';
|
||||
@@ -25,6 +26,7 @@ const loadBuiltInCommands = async (): Promise<SlashCommand[]> => [
|
||||
compressCommand,
|
||||
extensionsCommand,
|
||||
helpCommand,
|
||||
mcpCommand,
|
||||
memoryCommand,
|
||||
privacyCommand,
|
||||
statsCommand,
|
||||
|
||||
Reference in New Issue
Block a user