@@ -31,81 +31,49 @@ const CONFIG_FIXTURES = {
3131 WITH_INVALID_VALUE : path . resolve ( import . meta. dirname , ".." , ".." , "fixtures" , "config-with-invalid-value.json" ) ,
3232} ;
3333
34+ // Expected hardcoded values (what we had before)
35+ const expectedDefaults = {
36+ apiBaseUrl : "https://cloud.mongodb.com/" ,
37+ logPath : getLogPath ( ) ,
38+ exportsPath : getExportsPath ( ) ,
39+ exportTimeoutMs : 5 * 60 * 1000 , // 5 minutes
40+ exportCleanupIntervalMs : 2 * 60 * 1000 , // 2 minutes
41+ disabledTools : [ ] ,
42+ telemetry : "enabled" ,
43+ readOnly : false ,
44+ indexCheck : false ,
45+ confirmationRequiredTools : [
46+ "atlas-create-access-list" ,
47+ "atlas-create-db-user" ,
48+ "drop-database" ,
49+ "drop-collection" ,
50+ "delete-many" ,
51+ "drop-index" ,
52+ ] ,
53+ transport : "stdio" ,
54+ httpPort : 3000 ,
55+ httpHost : "127.0.0.1" ,
56+ loggers : [ "disk" , "mcp" ] ,
57+ idleTimeoutMs : 10 * 60 * 1000 , // 10 minutes
58+ notificationTimeoutMs : 9 * 60 * 1000 , // 9 minutes
59+ httpHeaders : { } ,
60+ maxDocumentsPerQuery : 100 ,
61+ maxBytesPerQuery : 16 * 1024 * 1024 , // ~16 mb
62+ atlasTemporaryDatabaseUserLifetimeMs : 4 * 60 * 60 * 1000 , // 4 hours
63+ voyageApiKey : "" ,
64+ vectorSearchDimensions : 1024 ,
65+ vectorSearchSimilarityFunction : "euclidean" ,
66+ disableEmbeddingsValidation : false ,
67+ previewFeatures : [ ] ,
68+ toolMetadataOverrides : { } ,
69+ } ;
70+
3471describe ( "config" , ( ) => {
3572 it ( "should generate defaults from UserConfigSchema that match expected values" , ( ) => {
36- // Expected hardcoded values (what we had before)
37- const expectedDefaults = {
38- apiBaseUrl : "https://cloud.mongodb.com/" ,
39- logPath : getLogPath ( ) ,
40- exportsPath : getExportsPath ( ) ,
41- exportTimeoutMs : 5 * 60 * 1000 , // 5 minutes
42- exportCleanupIntervalMs : 2 * 60 * 1000 , // 2 minutes
43- disabledTools : [ ] ,
44- telemetry : "enabled" ,
45- readOnly : false ,
46- indexCheck : false ,
47- confirmationRequiredTools : [
48- "atlas-create-access-list" ,
49- "atlas-create-db-user" ,
50- "drop-database" ,
51- "drop-collection" ,
52- "delete-many" ,
53- "drop-index" ,
54- ] ,
55- transport : "stdio" ,
56- httpPort : 3000 ,
57- httpHost : "127.0.0.1" ,
58- loggers : [ "disk" , "mcp" ] ,
59- idleTimeoutMs : 10 * 60 * 1000 , // 10 minutes
60- notificationTimeoutMs : 9 * 60 * 1000 , // 9 minutes
61- httpHeaders : { } ,
62- maxDocumentsPerQuery : 100 ,
63- maxBytesPerQuery : 16 * 1024 * 1024 , // ~16 mb
64- atlasTemporaryDatabaseUserLifetimeMs : 4 * 60 * 60 * 1000 , // 4 hours
65- voyageApiKey : "" ,
66- vectorSearchDimensions : 1024 ,
67- vectorSearchSimilarityFunction : "euclidean" ,
68- disableEmbeddingsValidation : false ,
69- previewFeatures : [ ] ,
70- } ;
7173 expect ( UserConfigSchema . parse ( { } ) ) . toStrictEqual ( expectedDefaults ) ;
7274 } ) ;
7375
7476 it ( "should generate defaults when no config sources are populated" , ( ) => {
75- const expectedDefaults = {
76- apiBaseUrl : "https://cloud.mongodb.com/" ,
77- logPath : getLogPath ( ) ,
78- exportsPath : getExportsPath ( ) ,
79- exportTimeoutMs : 5 * 60 * 1000 , // 5 minutes
80- exportCleanupIntervalMs : 2 * 60 * 1000 , // 2 minutes
81- disabledTools : [ ] ,
82- telemetry : "enabled" ,
83- readOnly : false ,
84- indexCheck : false ,
85- confirmationRequiredTools : [
86- "atlas-create-access-list" ,
87- "atlas-create-db-user" ,
88- "drop-database" ,
89- "drop-collection" ,
90- "delete-many" ,
91- "drop-index" ,
92- ] ,
93- transport : "stdio" ,
94- httpPort : 3000 ,
95- httpHost : "127.0.0.1" ,
96- loggers : [ "disk" , "mcp" ] ,
97- idleTimeoutMs : 10 * 60 * 1000 , // 10 minutes
98- notificationTimeoutMs : 9 * 60 * 1000 , // 9 minutes
99- httpHeaders : { } ,
100- maxDocumentsPerQuery : 100 ,
101- maxBytesPerQuery : 16 * 1024 * 1024 , // ~16 mb
102- atlasTemporaryDatabaseUserLifetimeMs : 4 * 60 * 60 * 1000 , // 4 hours
103- voyageApiKey : "" ,
104- vectorSearchDimensions : 1024 ,
105- vectorSearchSimilarityFunction : "euclidean" ,
106- disableEmbeddingsValidation : false ,
107- previewFeatures : [ ] ,
108- } ;
10977 expect ( createUserConfig ( ) ) . toStrictEqual ( expectedDefaults ) ;
11078 } ) ;
11179
0 commit comments