mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-16 10:16:49 +00:00
- add a shared command catalog for root help and completion routing - replace shell-local completion logic with a hidden __complete backend - add topic help and parity tests for router, help, and completion coverage
28 lines
1007 B
TypeScript
28 lines
1007 B
TypeScript
import { describe, expect, test } from 'bun:test';
|
|
|
|
import { ROOT_COMMAND_CATALOG, getAllRootCommandTokens } from '../../../src/commands/command-catalog';
|
|
import { ROOT_COMMAND_ROUTES } from '../../../src/commands/root-command-router';
|
|
|
|
describe('command catalog', () => {
|
|
test('covers every routed root command and alias', () => {
|
|
const catalogTokens = new Set(getAllRootCommandTokens());
|
|
|
|
for (const route of ROOT_COMMAND_ROUTES) {
|
|
expect(catalogTokens.has(route.name)).toBe(true);
|
|
for (const alias of route.aliases || []) {
|
|
expect(catalogTokens.has(alias)).toBe(true);
|
|
}
|
|
}
|
|
});
|
|
|
|
test('keeps hidden operational hooks out of the public help surface', () => {
|
|
const hiddenCommands = ROOT_COMMAND_CATALOG.filter((entry) => entry.visibility === 'hidden').map(
|
|
(entry) => entry.name
|
|
);
|
|
|
|
expect(hiddenCommands).toContain('--install');
|
|
expect(hiddenCommands).toContain('--uninstall');
|
|
expect(hiddenCommands).toContain('__complete');
|
|
});
|
|
});
|