Add test files: fixtures, generators, spec parser, validation
This commit is contained in:
53
test/fixtures.ts
Normal file
53
test/fixtures.ts
Normal 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 };
|
||||||
Reference in New Issue
Block a user