mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-18 18:11:02 -07:00
Introduce GEMINI_CLI_HOME for strict test isolation (#15907)
This commit is contained in:
@@ -27,6 +27,7 @@ vi.mock('@google/gemini-cli-core', async (importOriginal) => {
|
||||
return {
|
||||
...actual,
|
||||
coreEvents: mockCoreEvents,
|
||||
homedir: () => '/mock/home/user',
|
||||
Storage: class extends actual.Storage {
|
||||
static override getGlobalSettingsPath = () =>
|
||||
'/mock/home/user/.gemini/settings.json';
|
||||
@@ -52,11 +53,15 @@ vi.mock('./trustedFolders.js', () => ({
|
||||
},
|
||||
}));
|
||||
|
||||
vi.mock('os', () => ({
|
||||
homedir: () => '/mock/home/user',
|
||||
platform: () => 'linux',
|
||||
totalmem: () => 16 * 1024 * 1024 * 1024,
|
||||
}));
|
||||
vi.mock('os', async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof import('node:os')>();
|
||||
return {
|
||||
...actual,
|
||||
homedir: () => '/mock/home/user',
|
||||
platform: () => 'linux',
|
||||
totalmem: () => 16 * 1024 * 1024 * 1024,
|
||||
};
|
||||
});
|
||||
|
||||
vi.mock('fs', async (importOriginal) => {
|
||||
const actualFs = await importOriginal<typeof fs>();
|
||||
|
||||
Reference in New Issue
Block a user