mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-30 12:40:44 +00:00
Fix failing tests in @packages/cli/src/gemini.test.tsx
- Add missing config methods: getUsageStatisticsEnabled, getSessionId, getOutputFormat - Fix stdin TTY setting for stream-json mode to ensure correct code path execution - Fix duplicate key definition issue Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
parent
7679910f26
commit
b8eccc4a4f
1 changed files with 5 additions and 1 deletions
|
|
@ -262,7 +262,7 @@ describe('gemini.tsx main function', () => {
|
|||
'isRaw',
|
||||
);
|
||||
Object.defineProperty(process.stdin, 'isTTY', {
|
||||
value: true,
|
||||
value: false, // 在 stream-json 模式下应为 false
|
||||
configurable: true,
|
||||
});
|
||||
Object.defineProperty(process.stdin, 'isRaw', {
|
||||
|
|
@ -344,6 +344,9 @@ describe('gemini.tsx main function', () => {
|
|||
getInputFormat: () => 'stream-json',
|
||||
getContentGeneratorConfig: () => ({ authType: 'test-auth' }),
|
||||
getWarnings: () => [],
|
||||
getUsageStatisticsEnabled: () => true,
|
||||
getSessionId: () => 'test-session-id',
|
||||
getOutputFormat: () => OutputFormat.TEXT,
|
||||
} as unknown as Config;
|
||||
|
||||
vi.mocked(loadCliConfig).mockResolvedValue(configStub);
|
||||
|
|
@ -442,6 +445,7 @@ describe('gemini.tsx main function kitty protocol', () => {
|
|||
getScreenReader: () => false,
|
||||
getGeminiMdFileCount: () => 0,
|
||||
getWarnings: () => [],
|
||||
getUsageStatisticsEnabled: () => true,
|
||||
} as unknown as Config);
|
||||
vi.mocked(loadSettings).mockReturnValue({
|
||||
errors: [],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue