chore(test): install and configure vitest eslint plugin (#3228)

Co-authored-by: N. Taylor Mullen <ntaylormullen@google.com>
This commit is contained in:
Pascal Birchler
2025-08-25 16:21:47 +02:00
committed by GitHub
parent 04953d60c1
commit 49cce8a15d
10 changed files with 200 additions and 594 deletions

View File

@@ -720,19 +720,23 @@ describe('Hierarchical Memory Loading (config.ts) - Placeholder Suite', () => {
// readability, and content based on paths derived from the mocked os.homedir().
// 3. Spies on console functions (for logger output) are correctly set up if needed.
// Example of a previously failing test structure:
/*
it('should correctly use mocked homedir for global path', async () => {
it.skip('should correctly use mocked homedir for global path', async () => {
const MOCK_GEMINI_DIR_LOCAL = path.join('/mock/home/user', '.gemini');
const MOCK_GLOBAL_PATH_LOCAL = path.join(MOCK_GEMINI_DIR_LOCAL, 'GEMINI.md');
const MOCK_GLOBAL_PATH_LOCAL = path.join(
MOCK_GEMINI_DIR_LOCAL,
'GEMINI.md',
);
mockFs({
[MOCK_GLOBAL_PATH_LOCAL]: { type: 'file', content: 'GlobalContentOnly' }
[MOCK_GLOBAL_PATH_LOCAL]: { type: 'file', content: 'GlobalContentOnly' },
});
const memory = await loadHierarchicalGeminiMemory("/some/other/cwd", false);
const memory = await loadHierarchicalGeminiMemory('/some/other/cwd', false);
expect(memory).toBe('GlobalContentOnly');
expect(vi.mocked(os.homedir)).toHaveBeenCalled();
expect(fsPromises.readFile).toHaveBeenCalledWith(MOCK_GLOBAL_PATH_LOCAL, 'utf-8');
expect(fsPromises.readFile).toHaveBeenCalledWith(
MOCK_GLOBAL_PATH_LOCAL,
'utf-8',
);
});
*/
});
describe('mergeMcpServers', () => {
@@ -1294,7 +1298,7 @@ describe('loadCliConfig with allowed-mcp-server-names', () => {
});
});
it('should override allowMCPServers with excludeMCPServers if overlapping ', async () => {
it('should override allowMCPServers with excludeMCPServers if overlapping', async () => {
process.argv = ['node', 'script.js'];
const argv = await parseArguments();
const settings: Settings = {
@@ -1308,7 +1312,7 @@ describe('loadCliConfig with allowed-mcp-server-names', () => {
});
});
it('should prioritize mcp server flag if set ', async () => {
it('should prioritize mcp server flag if set', async () => {
process.argv = [
'node',
'script.js',