mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-17 17:41:24 -07:00
chore: Extract '.gemini' to GEMINI_DIR constant (#10540)
Co-authored-by: Richie Foreman <richie.foreman@gmail.com>
This commit is contained in:
committed by
GitHub
parent
7beaa368a9
commit
518caae62e
@@ -11,6 +11,7 @@ import * as os from 'node:os';
|
||||
import { getFolderStructure } from './getFolderStructure.js';
|
||||
import { FileDiscoveryService } from '../services/fileDiscoveryService.js';
|
||||
import * as path from 'node:path';
|
||||
import { GEMINI_DIR } from './paths.js';
|
||||
|
||||
describe('getFolderStructure', () => {
|
||||
let testRootDir: string;
|
||||
@@ -255,8 +256,8 @@ ${testRootDir}${path.sep}
|
||||
await createTestFile('file1.txt');
|
||||
await createTestFile('node_modules', 'some-package', 'index.js');
|
||||
await createTestFile('ignored.txt');
|
||||
await createTestFile('.gemini', 'config.yaml');
|
||||
await createTestFile('.gemini', 'logs.json');
|
||||
await createTestFile(GEMINI_DIR, 'config.yaml');
|
||||
await createTestFile(GEMINI_DIR, 'logs.json');
|
||||
|
||||
const fileService = new FileDiscoveryService(testRootDir);
|
||||
const structure = await getFolderStructure(testRootDir, {
|
||||
@@ -301,8 +302,8 @@ ${testRootDir}${path.sep}
|
||||
await createTestFile('file1.txt');
|
||||
await createTestFile('node_modules', 'some-package', 'index.js');
|
||||
await createTestFile('ignored.txt');
|
||||
await createTestFile('.gemini', 'config.yaml');
|
||||
await createTestFile('.gemini', 'logs.json');
|
||||
await createTestFile(GEMINI_DIR, 'config.yaml');
|
||||
await createTestFile(GEMINI_DIR, 'logs.json');
|
||||
|
||||
const fileService = new FileDiscoveryService(testRootDir);
|
||||
const structure = await getFolderStructure(testRootDir, {
|
||||
@@ -321,8 +322,8 @@ ${testRootDir}${path.sep}
|
||||
await createTestFile('file1.txt');
|
||||
await createTestFile('node_modules', 'some-package', 'index.js');
|
||||
await createTestFile('ignored.txt');
|
||||
await createTestFile('.gemini', 'config.yaml');
|
||||
await createTestFile('.gemini', 'logs.json');
|
||||
await createTestFile(GEMINI_DIR, 'config.yaml');
|
||||
await createTestFile(GEMINI_DIR, 'logs.json');
|
||||
|
||||
const fileService = new FileDiscoveryService(testRootDir);
|
||||
const structure = await getFolderStructure(testRootDir, {
|
||||
|
||||
@@ -11,6 +11,7 @@ import * as fs from 'node:fs';
|
||||
import * as os from 'node:os';
|
||||
import path from 'node:path';
|
||||
import { randomUUID } from 'node:crypto';
|
||||
import { GEMINI_DIR } from './paths.js';
|
||||
|
||||
vi.mock('node:fs', async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof import('node:fs')>();
|
||||
@@ -41,7 +42,7 @@ describe('InstallationManager', () => {
|
||||
let tempHomeDir: string;
|
||||
let installationManager: InstallationManager;
|
||||
const installationIdFile = () =>
|
||||
path.join(tempHomeDir, '.gemini', 'installation_id');
|
||||
path.join(tempHomeDir, GEMINI_DIR, 'installation_id');
|
||||
|
||||
beforeEach(() => {
|
||||
tempHomeDir = fs.mkdtempSync(
|
||||
|
||||
@@ -10,6 +10,7 @@ import { UserAccountManager } from './userAccountManager.js';
|
||||
import * as fs from 'node:fs';
|
||||
import * as os from 'node:os';
|
||||
import path from 'node:path';
|
||||
import { GEMINI_DIR } from './paths.js';
|
||||
|
||||
vi.mock('os', async (importOriginal) => {
|
||||
const os = await importOriginal<typeof import('os')>();
|
||||
@@ -30,7 +31,7 @@ describe('UserAccountManager', () => {
|
||||
);
|
||||
(os.homedir as Mock).mockReturnValue(tempHomeDir);
|
||||
accountsFile = () =>
|
||||
path.join(tempHomeDir, '.gemini', 'google_accounts.json');
|
||||
path.join(tempHomeDir, GEMINI_DIR, 'google_accounts.json');
|
||||
userAccountManager = new UserAccountManager();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user