Add test files: fixtures, generators, spec parser, validation

This commit is contained in:
2026-01-30 07:12:55 +00:00
parent 51521e7b31
commit 86ee9e595a

53
test/fixtures.ts Normal file
View File

@@ -0,0 +1,53 @@
import { CLISpec, Option, Command, Argument, Example } from '../src/types/spec.js';
const testSpec: CLISpec = {
name: 'test-cli',
version: '1.0.0',
description: 'A test CLI tool',
author: 'Test Author',
commands: [
{
name: 'start',
description: 'Start the service',
options: [
{
name: 'port',
short: 'p',
description: 'Port number',
type: 'number',
default: 8080,
},
],
arguments: [
{
name: 'service',
description: 'Service name',
required: true,
},
],
},
{
name: 'stop',
description: 'Stop the service',
options: [
{
name: 'force',
description: 'Force stop',
type: 'boolean',
default: false,
},
],
},
],
globalOptions: [
{
name: 'verbose',
short: 'v',
description: 'Enable verbose output',
type: 'boolean',
default: false,
},
],
};
export { testSpec };