Function
getSubCommand
(
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([]); |
Tested by
no test coverage detected