diff options
| author | shrutip90 <[email protected]> | 2025-08-06 15:27:21 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-08-06 22:27:21 +0000 |
| commit | 626844b539af6bf6d21a04d43173074c98b71474 (patch) | |
| tree | d402215e0ff6a3a3a464f6567997008e1f211f52 /packages/cli/src/config/config.test.ts | |
| parent | 5cd63a6abc0531ec5e6781b2fa065cd22a64eede (diff) | |
experiment: Add feature exp flag for folder trust (#5709)
Diffstat (limited to 'packages/cli/src/config/config.test.ts')
| -rw-r--r-- | packages/cli/src/config/config.test.ts | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/packages/cli/src/config/config.test.ts b/packages/cli/src/config/config.test.ts index 64ecdbb8..6a7e3b57 100644 --- a/packages/cli/src/config/config.test.ts +++ b/packages/cli/src/config/config.test.ts @@ -1009,6 +1009,39 @@ describe('loadCliConfig ideModeFeature', () => { }); }); +describe('loadCliConfig folderTrustFeature', () => { + const originalArgv = process.argv; + const originalEnv = { ...process.env }; + + beforeEach(() => { + vi.resetAllMocks(); + vi.mocked(os.homedir).mockReturnValue('/mock/home/user'); + process.env.GEMINI_API_KEY = 'test-api-key'; + }); + + afterEach(() => { + process.argv = originalArgv; + process.env = originalEnv; + vi.restoreAllMocks(); + }); + + it('should be false by default', async () => { + process.argv = ['node', 'script.js']; + const settings: Settings = {}; + const argv = await parseArguments(); + const config = await loadCliConfig(settings, [], 'test-session', argv); + expect(config.getFolderTrustFeature()).toBe(false); + }); + + it('should be true when settings.folderTrustFeature is true', async () => { + process.argv = ['node', 'script.js']; + const argv = await parseArguments(); + const settings: Settings = { folderTrustFeature: true }; + const config = await loadCliConfig(settings, [], 'test-session', argv); + expect(config.getFolderTrustFeature()).toBe(true); + }); +}); + vi.mock('fs', async () => { const actualFs = await vi.importActual<typeof fs>('fs'); const MOCK_CWD1 = process.cwd(); |
