Skip to content

Commit eda7b90

Browse files
NianJiuZstclaude
andcommitted
test: add unit tests for text repl command
Verify command metadata and non-interactive mode rejection. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8c157bd commit eda7b90

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

test/commands/text/repl.test.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ describe('text repl command', () => {
88
expect(cmd.name).toBe('text repl');
99
expect(cmd.description).toContain('interactive');
1010
expect(cmd.options).toBeDefined();
11-
expect(cmd.options.length).toBeGreaterThan(0);
11+
12+
const options = cmd.options!;
13+
expect(options.length).toBeGreaterThan(0);
1214

1315
// Verify key options exist
14-
const flags = cmd.options.map((o: { flag: string }) => o.flag);
15-
expect(flags.some((f: string) => f.includes('model'))).toBe(true);
16-
expect(flags.some((f: string) => f.includes('system'))).toBe(true);
17-
expect(flags.some((f: string) => f.includes('max-tokens'))).toBe(true);
16+
const flagNames = options.map(o => o.flag);
17+
expect(flagNames.some(f => f.includes('model'))).toBe(true);
18+
expect(flagNames.some(f => f.includes('system'))).toBe(true);
19+
expect(flagNames.some(f => f.includes('max-tokens'))).toBe(true);
1820
});
1921

2022
it('rejects non-interactive mode', async () => {

0 commit comments

Comments
 (0)