refactor: update test structure and clean up unused code in cli and sdk

This commit is contained in:
mingholy.lmh
2025-11-25 11:45:34 +08:00
parent ad9ba914e1
commit ac6aecb622
14 changed files with 2620 additions and 401 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -11,7 +11,6 @@ import {
parseExecutableSpec,
prepareSpawnInfo,
findNativeCliPath,
resolveCliPath,
} from '../../src/utils/cliPath.js';
// Mock fs module
@@ -421,28 +420,6 @@ describe('CLI Path Utilities', () => {
});
});
describe('resolveCliPath (backward compatibility)', () => {
it('should resolve CLI path for backward compatibility', () => {
mockFs.existsSync.mockReturnValue(true);
const result = resolveCliPath('/path/to/qwen');
expect(result).toBe('/path/to/qwen');
});
it('should auto-detect when no path provided', () => {
const originalEnv = process.env['QWEN_CODE_CLI_PATH'];
process.env['QWEN_CODE_CLI_PATH'] = '/usr/local/bin/qwen';
mockFs.existsSync.mockReturnValue(true);
const result = resolveCliPath();
expect(result).toBe('/usr/local/bin/qwen');
process.env['QWEN_CODE_CLI_PATH'] = originalEnv;
});
});
describe('real-world use cases', () => {
beforeEach(() => {
mockFs.existsSync.mockReturnValue(true);