mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-25 21:41:12 -07:00
Introduce GEMINI_CLI_HOME for strict test isolation (#15907)
This commit is contained in:
@@ -35,6 +35,16 @@ vi.mock('os', async (importOriginal) => {
|
||||
};
|
||||
});
|
||||
|
||||
vi.mock('../utils/paths.js', async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof import('../utils/paths.js')>();
|
||||
return {
|
||||
...actual,
|
||||
homedir: vi.fn(),
|
||||
};
|
||||
});
|
||||
|
||||
import { homedir as pathsHomedir } from './paths.js';
|
||||
|
||||
describe('memoryDiscovery', () => {
|
||||
const DEFAULT_FOLDER_TRUST = true;
|
||||
let testRootDir: string;
|
||||
@@ -67,6 +77,7 @@ describe('memoryDiscovery', () => {
|
||||
cwd = await createEmptyDir(path.join(projectRoot, 'src'));
|
||||
homedir = await createEmptyDir(path.join(testRootDir, 'userhome'));
|
||||
vi.mocked(os.homedir).mockReturnValue(homedir);
|
||||
vi.mocked(pathsHomedir).mockReturnValue(homedir);
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
|
||||
Reference in New Issue
Block a user