Skip to content

Commit 9c54a3b

Browse files
chore: fix config expectation
1 parent 78ef292 commit 9c54a3b

File tree

1 file changed

+37
-69
lines changed

1 file changed

+37
-69
lines changed

tests/unit/common/config.test.ts

Lines changed: 37 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -25,81 +25,49 @@ function createEnvironment(): {
2525
};
2626
}
2727

28+
// Expected hardcoded values (what we had before)
29+
const expectedDefaults = {
30+
apiBaseUrl: "https://cloud.mongodb.com/",
31+
logPath: getLogPath(),
32+
exportsPath: getExportsPath(),
33+
exportTimeoutMs: 5 * 60 * 1000, // 5 minutes
34+
exportCleanupIntervalMs: 2 * 60 * 1000, // 2 minutes
35+
disabledTools: [],
36+
telemetry: "enabled",
37+
readOnly: false,
38+
indexCheck: false,
39+
confirmationRequiredTools: [
40+
"atlas-create-access-list",
41+
"atlas-create-db-user",
42+
"drop-database",
43+
"drop-collection",
44+
"delete-many",
45+
"drop-index",
46+
],
47+
transport: "stdio",
48+
httpPort: 3000,
49+
httpHost: "127.0.0.1",
50+
loggers: ["disk", "mcp"],
51+
idleTimeoutMs: 10 * 60 * 1000, // 10 minutes
52+
notificationTimeoutMs: 9 * 60 * 1000, // 9 minutes
53+
httpHeaders: {},
54+
maxDocumentsPerQuery: 100,
55+
maxBytesPerQuery: 16 * 1024 * 1024, // ~16 mb
56+
atlasTemporaryDatabaseUserLifetimeMs: 4 * 60 * 60 * 1000, // 4 hours
57+
voyageApiKey: "",
58+
vectorSearchDimensions: 1024,
59+
vectorSearchSimilarityFunction: "euclidean",
60+
disableEmbeddingsValidation: false,
61+
previewFeatures: [],
62+
dry: false,
63+
};
64+
2865
describe("config", () => {
2966
it("should generate defaults from UserConfigSchema that match expected values", () => {
30-
// Expected hardcoded values (what we had before)
31-
const expectedDefaults = {
32-
apiBaseUrl: "https://cloud.mongodb.com/",
33-
logPath: getLogPath(),
34-
exportsPath: getExportsPath(),
35-
exportTimeoutMs: 5 * 60 * 1000, // 5 minutes
36-
exportCleanupIntervalMs: 2 * 60 * 1000, // 2 minutes
37-
disabledTools: [],
38-
telemetry: "enabled",
39-
readOnly: false,
40-
indexCheck: false,
41-
confirmationRequiredTools: [
42-
"atlas-create-access-list",
43-
"atlas-create-db-user",
44-
"drop-database",
45-
"drop-collection",
46-
"delete-many",
47-
"drop-index",
48-
],
49-
transport: "stdio",
50-
httpPort: 3000,
51-
httpHost: "127.0.0.1",
52-
loggers: ["disk", "mcp"],
53-
idleTimeoutMs: 10 * 60 * 1000, // 10 minutes
54-
notificationTimeoutMs: 9 * 60 * 1000, // 9 minutes
55-
httpHeaders: {},
56-
maxDocumentsPerQuery: 100,
57-
maxBytesPerQuery: 16 * 1024 * 1024, // ~16 mb
58-
atlasTemporaryDatabaseUserLifetimeMs: 4 * 60 * 60 * 1000, // 4 hours
59-
voyageApiKey: "",
60-
vectorSearchDimensions: 1024,
61-
vectorSearchSimilarityFunction: "euclidean",
62-
disableEmbeddingsValidation: false,
63-
previewFeatures: [],
64-
};
6567
expect(UserConfigSchema.parse({})).toStrictEqual(expectedDefaults);
6668
});
6769

6870
it("should generate defaults when no config sources are populated", () => {
69-
const expectedDefaults = {
70-
apiBaseUrl: "https://cloud.mongodb.com/",
71-
logPath: getLogPath(),
72-
exportsPath: getExportsPath(),
73-
exportTimeoutMs: 5 * 60 * 1000, // 5 minutes
74-
exportCleanupIntervalMs: 2 * 60 * 1000, // 2 minutes
75-
disabledTools: [],
76-
telemetry: "enabled",
77-
readOnly: false,
78-
indexCheck: false,
79-
confirmationRequiredTools: [
80-
"atlas-create-access-list",
81-
"atlas-create-db-user",
82-
"drop-database",
83-
"drop-collection",
84-
"delete-many",
85-
"drop-index",
86-
],
87-
transport: "stdio",
88-
httpPort: 3000,
89-
httpHost: "127.0.0.1",
90-
loggers: ["disk", "mcp"],
91-
idleTimeoutMs: 10 * 60 * 1000, // 10 minutes
92-
notificationTimeoutMs: 9 * 60 * 1000, // 9 minutes
93-
httpHeaders: {},
94-
maxDocumentsPerQuery: 100,
95-
maxBytesPerQuery: 16 * 1024 * 1024, // ~16 mb
96-
atlasTemporaryDatabaseUserLifetimeMs: 4 * 60 * 60 * 1000, // 4 hours
97-
voyageApiKey: "",
98-
vectorSearchDimensions: 1024,
99-
vectorSearchSimilarityFunction: "euclidean",
100-
disableEmbeddingsValidation: false,
101-
previewFeatures: [],
102-
};
10371
expect(createUserConfig()).toStrictEqual(expectedDefaults);
10472
});
10573

0 commit comments

Comments
 (0)