mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
fix: mock path for cross platform compability in test cases
This commit is contained in:
@@ -399,13 +399,15 @@ describe('CLI Path Utilities', () => {
|
|||||||
delete process.env['QWEN_CODE_CLI_PATH'];
|
delete process.env['QWEN_CODE_CLI_PATH'];
|
||||||
|
|
||||||
// Mock fs.existsSync to return true for volta bin
|
// Mock fs.existsSync to return true for volta bin
|
||||||
mockFs.existsSync.mockImplementation((path) => {
|
// Use path.join to match platform-specific path separators
|
||||||
return path.toString().includes('.volta/bin/qwen');
|
const voltaBinPath = path.join('.volta', 'bin', 'qwen');
|
||||||
|
mockFs.existsSync.mockImplementation((p) => {
|
||||||
|
return p.toString().includes(voltaBinPath);
|
||||||
});
|
});
|
||||||
|
|
||||||
const result = findNativeCliPath();
|
const result = findNativeCliPath();
|
||||||
|
|
||||||
expect(result).toContain('.volta/bin/qwen');
|
expect(result).toContain(voltaBinPath);
|
||||||
|
|
||||||
process.env['QWEN_CODE_CLI_PATH'] = originalEnv;
|
process.env['QWEN_CODE_CLI_PATH'] = originalEnv;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user