2026-02-21 04:17:31 +00:00
|
|
|
import { describe, it, expect } from 'vitest';
|
|
|
|
|
import { createProgram } from '../src/index.js';
|
|
|
|
|
|
|
|
|
|
describe('createProgram', () => {
|
|
|
|
|
it('creates a Commander program', () => {
|
|
|
|
|
const program = createProgram();
|
|
|
|
|
expect(program.name()).toBe('mcpctl');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('has version flag', () => {
|
|
|
|
|
const program = createProgram();
|
|
|
|
|
expect(program.version()).toBe('0.1.0');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('has config subcommand', () => {
|
|
|
|
|
const program = createProgram();
|
|
|
|
|
const config = program.commands.find((c) => c.name() === 'config');
|
|
|
|
|
expect(config).toBeDefined();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('has status subcommand', () => {
|
|
|
|
|
const program = createProgram();
|
|
|
|
|
const status = program.commands.find((c) => c.name() === 'status');
|
|
|
|
|
expect(status).toBeDefined();
|
|
|
|
|
});
|
|
|
|
|
|
2026-02-22 16:43:35 +00:00
|
|
|
it('subcommands have output option', () => {
|
2026-02-21 04:17:31 +00:00
|
|
|
const program = createProgram();
|
2026-02-22 16:43:35 +00:00
|
|
|
const get = program.commands.find((c) => c.name() === 'get');
|
|
|
|
|
const opt = get?.options.find((o) => o.long === '--output');
|
2026-02-21 04:17:31 +00:00
|
|
|
expect(opt).toBeDefined();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('has daemon-url option', () => {
|
|
|
|
|
const program = createProgram();
|
|
|
|
|
const opt = program.options.find((o) => o.long === '--daemon-url');
|
|
|
|
|
expect(opt).toBeDefined();
|
|
|
|
|
});
|
|
|
|
|
});
|