44 lines
1.5 KiB
TypeScript
44 lines
1.5 KiB
TypeScript
import { describe, it, expect } from 'vitest';
|
|
import { createProgram } from './index.js';
|
|
|
|
describe('CLI program', () => {
|
|
it('creates a commander program with expected commands', () => {
|
|
const program = createProgram();
|
|
const commandNames = program.commands.map((c) => c.name());
|
|
|
|
expect(commandNames).toContain('start');
|
|
expect(commandNames).toContain('tui');
|
|
expect(commandNames).toContain('send');
|
|
expect(commandNames).toContain('sessions');
|
|
expect(commandNames).toContain('doctor');
|
|
expect(commandNames).toContain('config');
|
|
expect(commandNames).toContain('skills');
|
|
expect(commandNames).toContain('backup');
|
|
expect(commandNames).toContain('setup');
|
|
expect(commandNames).toContain('onboard');
|
|
expect(commandNames).toContain('companion');
|
|
|
|
expect(commandNames).toContain('openai-auth');
|
|
expect(commandNames).toContain('openai-key');
|
|
expect(commandNames).toContain('anthropic-auth');
|
|
expect(commandNames).toContain('zai-auth');
|
|
});
|
|
|
|
it('registers doctor strict flag on doctor command', () => {
|
|
const program = createProgram();
|
|
const doctor = program.commands.find((c) => c.name() === 'doctor');
|
|
const strictOption = doctor?.options.find((o) => o.long === '--strict');
|
|
expect(strictOption).toBeDefined();
|
|
});
|
|
|
|
it('has version info', () => {
|
|
const program = createProgram();
|
|
expect(program.version()).toBeDefined();
|
|
});
|
|
|
|
it('has description', () => {
|
|
const program = createProgram();
|
|
expect(program.description()).toContain('AI');
|
|
});
|
|
});
|