test(sandbox): add comment explaining lack of vi.restoreAllMocks()

This commit is contained in:
Spencer
2026-02-27 22:32:15 +00:00
parent f4e7d4159a
commit 5ec55fc718
2 changed files with 4 additions and 0 deletions

View File

@@ -122,6 +122,9 @@ describe('sandbox', () => {
});
afterEach(() => {
// Note: We intentionally avoid vi.restoreAllMocks() here because it clears the top-level
// vi.mock('@google/gemini-cli-core') entirely, making its un-exported constants (like GEMINI_DIR)
// undefined in subsequent tests. Call counts are still reset by clearAllMocks() in beforeEach.
process.env = originalEnv;
process.argv = originalArgv;
});

View File

@@ -10,3 +10,4 @@ export const REFERENCE_CONTENT_END = '--- End of content ---';
export const LOCAL_DEV_SANDBOX_IMAGE_NAME = 'gemini-cli-sandbox';
export const SANDBOX_NETWORK_NAME = 'gemini-cli-sandbox';
export const SANDBOX_PROXY_NAME = 'gemini-cli-sandbox-proxy';
export const GEMINI_DIR = '.gemini';