MCPcopy Create free account
hub / github.com/anus-dev/ANUS / getSubCommand

Function getSubCommand

packages/cli/src/ui/commands/chatCommand.test.ts:47–57  ·  view source on GitHub ↗
(
    name: 'list' | 'save' | 'resume' | 'delete',
  )

Source from the content-addressed store, hash-verified

45 let mockGetHistory: ReturnType<typeof vi.fn>;
46
47 const getSubCommand = (
48 name: 'list' | 'save' | 'resume' | 'delete',
49 ): SlashCommand => {
50 const subCommand = chatCommand.subCommands?.find(
51 (cmd) => cmd.name === name,
52 );
53 if (!subCommand) {
54 throw new Error(`/chat ${name} command not found.`);
55 }
56 return subCommand;
57 };
58
59 beforeEach(() => {
60 mockGetHistory = vi.fn().mockReturnValue([]);

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected