mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-09-08 22:22:52 +00:00
- Cache detectCursorCLI() result to avoid spawning `agent --version` on every LLM call - Fix stale JSDoc in cursor-client.ts (no longer uses stdin or stream-json) - Remove unused WikiOptions fields (model, baseUrl, apiKey) that were passed but never read by WikiGenerator - Fix inconsistent progress callback phase tracking in --review continuation path - Add wiki CLI help test covering --provider, --review, --verbose flags Made-with: Cursor
56 lines
1.9 KiB
TypeScript
56 lines
1.9 KiB
TypeScript
import { spawnSync } from 'node:child_process';
|
|
import path from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
import { describe, expect, it } from 'vitest';
|
|
|
|
const testDir = path.dirname(fileURLToPath(import.meta.url));
|
|
const repoRoot = path.resolve(testDir, '../..');
|
|
const cliEntry = path.join(repoRoot, 'src/cli/index.ts');
|
|
|
|
function runHelp(command: string) {
|
|
return spawnSync(process.execPath, ['--import', 'tsx', cliEntry, command, '--help'], {
|
|
cwd: repoRoot,
|
|
encoding: 'utf8',
|
|
});
|
|
}
|
|
|
|
describe('CLI help surface', () => {
|
|
it('query help keeps advanced search options without importing analyze deps', () => {
|
|
const result = runHelp('query');
|
|
|
|
expect(result.status).toBe(0);
|
|
expect(result.stdout).toContain('--context <text>');
|
|
expect(result.stdout).toContain('--goal <text>');
|
|
expect(result.stdout).toContain('--content');
|
|
expect(result.stderr).not.toContain('tree-sitter-kotlin');
|
|
});
|
|
|
|
it('context help keeps optional name and disambiguation flags', () => {
|
|
const result = runHelp('context');
|
|
|
|
expect(result.status).toBe(0);
|
|
expect(result.stdout).toContain('context [options] [name]');
|
|
expect(result.stdout).toContain('--uid <uid>');
|
|
expect(result.stdout).toContain('--file <path>');
|
|
});
|
|
|
|
it('impact help keeps repo and include-tests flags', () => {
|
|
const result = runHelp('impact');
|
|
|
|
expect(result.status).toBe(0);
|
|
expect(result.stdout).toContain('--depth <n>');
|
|
expect(result.stdout).toContain('--include-tests');
|
|
expect(result.stdout).toContain('--repo <name>');
|
|
});
|
|
|
|
it('wiki help shows provider, review, and verbose flags', () => {
|
|
const result = runHelp('wiki');
|
|
|
|
expect(result.status).toBe(0);
|
|
expect(result.stdout).toContain('--provider <provider>');
|
|
expect(result.stdout).toContain('--review');
|
|
expect(result.stdout).toContain('-v, --verbose');
|
|
expect(result.stdout).toContain('--model <model>');
|
|
expect(result.stdout).toContain('--gist');
|
|
});
|
|
});
|