@@ -8,14 +8,12 @@ import { describe, it, expect, beforeEach, vi, afterEach } from 'vitest';
88import * as fs from 'node:fs' ;
99import * as path from 'node:path' ;
1010import { tmpdir } from 'node:os' ;
11- import type {
12- ConfigParameters ,
13- ContentGeneratorConfig ,
14- } from '@google/gemini-cli-core' ;
11+ import type { ConfigParameters } from '@google/gemini-cli-core' ;
1512import {
1613 Config ,
1714 DEFAULT_FILE_FILTERING_OPTIONS ,
1815} from '@google/gemini-cli-core' ;
16+ import type { Settings } from './settingsSchema.js' ;
1917import { http , HttpResponse } from 'msw' ;
2018import { setupServer } from 'msw/node' ;
2119
@@ -36,12 +34,6 @@ afterAll(() => {
3634
3735const CLEARCUT_URL = 'https://play.googleapis.com/log' ;
3836
39- const TEST_CONTENT_GENERATOR_CONFIG : ContentGeneratorConfig = {
40- apiKey : 'test-key' ,
41- model : 'test-model' ,
42- userAgent : 'test-agent' ,
43- } ;
44-
4537// Mock file discovery service and tool registry
4638vi . mock ( '@google/gemini-cli-core' , async ( ) => {
4739 const actual = await vi . importActual ( '@google/gemini-cli-core' ) ;
@@ -75,13 +67,13 @@ describe('Configuration Integration Tests', () => {
7567 describe ( 'File Filtering Configuration' , ( ) => {
7668 it ( 'should load default file filtering settings' , async ( ) => {
7769 const configParams : ConfigParameters = {
70+ sessionId : 'test-session' ,
7871 cwd : '/tmp' ,
79- contentGeneratorConfig : TEST_CONTENT_GENERATOR_CONFIG ,
72+ model : 'test-model' ,
8073 embeddingModel : 'test-embedding-model' ,
81- sandbox : false ,
74+ sandbox : undefined ,
8275 targetDir : tempDir ,
8376 debugMode : false ,
84- fileFilteringRespectGitIgnore : undefined , // Should default to DEFAULT_FILE_FILTERING_OPTIONS
8577 } ;
8678
8779 const config = new Config ( configParams ) ;
@@ -93,10 +85,11 @@ describe('Configuration Integration Tests', () => {
9385
9486 it ( 'should load custom file filtering settings from configuration' , async ( ) => {
9587 const configParams : ConfigParameters = {
88+ sessionId : 'test-session' ,
9689 cwd : '/tmp' ,
97- contentGeneratorConfig : TEST_CONTENT_GENERATOR_CONFIG ,
90+ model : 'test-model' ,
9891 embeddingModel : 'test-embedding-model' ,
99- sandbox : false ,
92+ sandbox : undefined ,
10093 targetDir : tempDir ,
10194 debugMode : false ,
10295 fileFiltering : {
@@ -111,10 +104,11 @@ describe('Configuration Integration Tests', () => {
111104
112105 it ( 'should merge user and workspace file filtering settings' , async ( ) => {
113106 const configParams : ConfigParameters = {
107+ sessionId : 'test-session' ,
114108 cwd : '/tmp' ,
115- contentGeneratorConfig : TEST_CONTENT_GENERATOR_CONFIG ,
109+ model : 'test-model' ,
116110 embeddingModel : 'test-embedding-model' ,
117- sandbox : false ,
111+ sandbox : undefined ,
118112 targetDir : tempDir ,
119113 debugMode : false ,
120114 fileFiltering : {
@@ -131,10 +125,11 @@ describe('Configuration Integration Tests', () => {
131125 describe ( 'Configuration Integration' , ( ) => {
132126 it ( 'should handle partial configuration objects gracefully' , async ( ) => {
133127 const configParams : ConfigParameters = {
128+ sessionId : 'test-session' ,
134129 cwd : '/tmp' ,
135- contentGeneratorConfig : TEST_CONTENT_GENERATOR_CONFIG ,
130+ model : 'test-model' ,
136131 embeddingModel : 'test-embedding-model' ,
137- sandbox : false ,
132+ sandbox : undefined ,
138133 targetDir : tempDir ,
139134 debugMode : false ,
140135 fileFiltering : {
@@ -150,10 +145,11 @@ describe('Configuration Integration Tests', () => {
150145
151146 it ( 'should handle empty configuration objects gracefully' , async ( ) => {
152147 const configParams : ConfigParameters = {
148+ sessionId : 'test-session' ,
153149 cwd : '/tmp' ,
154- contentGeneratorConfig : TEST_CONTENT_GENERATOR_CONFIG ,
150+ model : 'test-model' ,
155151 embeddingModel : 'test-embedding-model' ,
156- sandbox : false ,
152+ sandbox : undefined ,
157153 targetDir : tempDir ,
158154 debugMode : false ,
159155 fileFiltering : { } ,
@@ -169,10 +165,11 @@ describe('Configuration Integration Tests', () => {
169165
170166 it ( 'should handle missing configuration sections gracefully' , async ( ) => {
171167 const configParams : ConfigParameters = {
168+ sessionId : 'test-session' ,
172169 cwd : '/tmp' ,
173- contentGeneratorConfig : TEST_CONTENT_GENERATOR_CONFIG ,
170+ model : 'test-model' ,
174171 embeddingModel : 'test-embedding-model' ,
175- sandbox : false ,
172+ sandbox : undefined ,
176173 targetDir : tempDir ,
177174 debugMode : false ,
178175 // Missing fileFiltering configuration
@@ -190,10 +187,11 @@ describe('Configuration Integration Tests', () => {
190187 describe ( 'Real-world Configuration Scenarios' , ( ) => {
191188 it ( 'should handle a security-focused configuration' , async ( ) => {
192189 const configParams : ConfigParameters = {
190+ sessionId : 'test-session' ,
193191 cwd : '/tmp' ,
194- contentGeneratorConfig : TEST_CONTENT_GENERATOR_CONFIG ,
192+ model : 'test-model' ,
195193 embeddingModel : 'test-embedding-model' ,
196- sandbox : false ,
194+ sandbox : undefined ,
197195 targetDir : tempDir ,
198196 debugMode : false ,
199197 fileFiltering : {
@@ -208,10 +206,11 @@ describe('Configuration Integration Tests', () => {
208206
209207 it ( 'should handle a CI/CD environment configuration' , async ( ) => {
210208 const configParams : ConfigParameters = {
209+ sessionId : 'test-session' ,
211210 cwd : '/tmp' ,
212- contentGeneratorConfig : TEST_CONTENT_GENERATOR_CONFIG ,
211+ model : 'test-model' ,
213212 embeddingModel : 'test-embedding-model' ,
214- sandbox : false ,
213+ sandbox : undefined ,
215214 targetDir : tempDir ,
216215 debugMode : false ,
217216 fileFiltering : {
@@ -228,10 +227,11 @@ describe('Configuration Integration Tests', () => {
228227 describe ( 'Checkpointing Configuration' , ( ) => {
229228 it ( 'should enable checkpointing when the setting is true' , async ( ) => {
230229 const configParams : ConfigParameters = {
230+ sessionId : 'test-session' ,
231231 cwd : '/tmp' ,
232- contentGeneratorConfig : TEST_CONTENT_GENERATOR_CONFIG ,
232+ model : 'test-model' ,
233233 embeddingModel : 'test-embedding-model' ,
234- sandbox : false ,
234+ sandbox : undefined ,
235235 targetDir : tempDir ,
236236 debugMode : false ,
237237 checkpointing : true ,
@@ -246,10 +246,11 @@ describe('Configuration Integration Tests', () => {
246246 describe ( 'Extension Context Files' , ( ) => {
247247 it ( 'should have an empty array for extension context files by default' , ( ) => {
248248 const configParams : ConfigParameters = {
249+ sessionId : 'test-session' ,
249250 cwd : '/tmp' ,
250- contentGeneratorConfig : TEST_CONTENT_GENERATOR_CONFIG ,
251+ model : 'test-model' ,
251252 embeddingModel : 'test-embedding-model' ,
252- sandbox : false ,
253+ sandbox : undefined ,
253254 targetDir : tempDir ,
254255 debugMode : false ,
255256 } ;
@@ -260,10 +261,11 @@ describe('Configuration Integration Tests', () => {
260261 it ( 'should correctly store and return extension context file paths' , ( ) => {
261262 const contextFiles = [ '/path/to/file1.txt' , '/path/to/file2.js' ] ;
262263 const configParams : ConfigParameters = {
264+ sessionId : 'test-session' ,
263265 cwd : '/tmp' ,
264- contentGeneratorConfig : TEST_CONTENT_GENERATOR_CONFIG ,
266+ model : 'test-model' ,
265267 embeddingModel : 'test-embedding-model' ,
266- sandbox : false ,
268+ sandbox : undefined ,
267269 targetDir : tempDir ,
268270 debugMode : false ,
269271 extensionContextFilePaths : contextFiles ,
@@ -274,11 +276,11 @@ describe('Configuration Integration Tests', () => {
274276 } ) ;
275277
276278 describe ( 'Approval Mode Integration Tests' , ( ) => {
277- let parseArguments : typeof import ( './config' ) . parseArguments ;
279+ let parseArguments : typeof import ( './config.js ' ) . parseArguments ;
278280
279281 beforeEach ( async ( ) => {
280282 // Import the argument parsing function for integration testing
281- const { parseArguments : parseArgs } = await import ( './config' ) ;
283+ const { parseArguments : parseArgs } = await import ( './config.js ' ) ;
282284 parseArguments = parseArgs ;
283285 } ) ;
284286
0 commit comments