feat: add google cli integration and fix tests

This commit is contained in:
Ralph Khreish
2025-08-28 18:42:32 +02:00
parent 9f8cb08515
commit c34d1417ca
17 changed files with 37 additions and 26 deletions

View File

@@ -2,6 +2,7 @@
* Tests for the add-task.js module
*/
import { jest } from '@jest/globals';
import { hasCodebaseAnalysis } from '../../../../../scripts/modules/config-manager.js';
// Mock the dependencies before importing the module under test
jest.unstable_mockModule('../../../../../scripts/modules/utils.js', () => ({
@@ -100,7 +101,7 @@ jest.unstable_mockModule(
'../../../../../scripts/modules/config-manager.js',
() => ({
getDefaultPriority: jest.fn(() => 'medium'),
isClaudeCode: jest.fn(() => false)
hasCodebaseAnalysis: jest.fn(() => false)
})
);

View File

@@ -6,6 +6,7 @@ import {
createGetTagAwareFilePathMock,
createSlugifyTagForFilePathMock
} from './setup.js';
import { hasCodebaseAnalysis } from '../../../../../scripts/modules/config-manager.js';
// Mock the dependencies before importing the module under test
jest.unstable_mockModule('../../../../../scripts/modules/utils.js', () => ({
@@ -188,7 +189,7 @@ jest.unstable_mockModule(
getAllProviders: jest.fn(() => ['anthropic', 'openai', 'perplexity']),
getVertexProjectId: jest.fn(() => undefined),
getVertexLocation: jest.fn(() => undefined),
isClaudeCode: jest.fn(() => false)
hasCodebaseAnalysis: jest.fn(() => false)
})
);

View File

@@ -6,6 +6,7 @@
import { jest } from '@jest/globals';
import fs from 'fs';
import path from 'path';
import { hasCodebaseAnalysis } from '../../../../../scripts/modules/config-manager.js';
// Mock the dependencies
jest.unstable_mockModule('../../../../../src/utils/path-utils.js', () => ({
@@ -302,7 +303,7 @@ jest.unstable_mockModule(
getAllProviders: jest.fn(() => ['anthropic', 'openai', 'perplexity']),
getVertexProjectId: jest.fn(() => undefined),
getVertexLocation: jest.fn(() => undefined),
isClaudeCode: jest.fn(() => false)
hasCodebaseAnalysis: jest.fn(() => false)
})
);

View File

@@ -125,7 +125,8 @@ jest.unstable_mockModule(
getDebugFlag: jest.fn(() => false),
getDefaultNumTasks: jest.fn(() => 10),
getMainProvider: jest.fn(() => 'openai'),
getResearchProvider: jest.fn(() => 'perplexity')
getResearchProvider: jest.fn(() => 'perplexity'),
hasCodebaseAnalysis: jest.fn(() => false)
})
);

View File

@@ -187,7 +187,8 @@ jest.unstable_mockModule(
getDefaultNumTasks: jest.fn(() => 10),
getDefaultPriority: jest.fn(() => 'medium'),
getMainProvider: jest.fn(() => 'openai'),
getResearchProvider: jest.fn(() => 'perplexity')
getResearchProvider: jest.fn(() => 'perplexity'),
hasCodebaseAnalysis: jest.fn(() => false)
})
);

View File

@@ -53,7 +53,7 @@ jest.unstable_mockModule(
'../../../../../scripts/modules/config-manager.js',
() => ({
getDebugFlag: jest.fn(() => false),
isClaudeCode: jest.fn(() => false)
hasCodebaseAnalysis: jest.fn(() => false)
})
);

View File

@@ -52,7 +52,7 @@ jest.unstable_mockModule(
() => ({
getDebugFlag: jest.fn(() => false),
isApiKeySet: jest.fn(() => true),
isClaudeCode: jest.fn(() => false)
hasCodebaseAnalysis: jest.fn(() => false)
})
);

View File

@@ -45,7 +45,7 @@ jest.unstable_mockModule(
'../../../../../scripts/modules/config-manager.js',
() => ({
getDebugFlag: jest.fn(() => false),
isClaudeCode: jest.fn(() => false)
hasCodebaseAnalysis: jest.fn(() => false)
})
);