@@ -12,6 +12,20 @@ import type { Secret } from "../../../src/common/keychain.js";
12
12
13
13
describe ( "config" , ( ) => {
14
14
describe ( "env var parsing" , ( ) => {
15
+ describe ( "mongodb urls" , ( ) => {
16
+ it ( "should not try to parse a multiple-host urls" , ( ) => {
17
+ const actual = setupUserConfig ( {
18
+ env : {
19
+ MDB_MCP_CONNECTION_STRING : "mongodb://user:password@host1,host2,host3/" ,
20
+ } ,
21
+ cli : [ ] ,
22
+ defaults : defaultUserConfig ,
23
+ } ) ;
24
+
25
+ expect ( actual . connectionString ) . toEqual ( "mongodb://user:password@host1,host2,host3/" ) ;
26
+ } ) ;
27
+ } ) ;
28
+
15
29
describe ( "string cases" , ( ) => {
16
30
const testCases = [
17
31
{ envVar : "MDB_MCP_API_BASE_URL" , property : "apiBaseUrl" , value : "http://test.com" } ,
@@ -67,6 +81,16 @@ describe("config", () => {
67
81
} ) ;
68
82
69
83
describe ( "cli parsing" , ( ) => {
84
+ it ( "should not try to parse a multiple-host urls" , ( ) => {
85
+ const actual = setupUserConfig ( {
86
+ cli : [ "myself" , "--" , "--connectionString" , "mongodb://user:password@host1,host2,host3/" ] ,
87
+ env : { } ,
88
+ defaults : defaultUserConfig ,
89
+ } ) ;
90
+
91
+ expect ( actual . connectionString ) . toEqual ( "mongodb://user:password@host1,host2,host3/" ) ;
92
+ } ) ;
93
+
70
94
describe ( "string use cases" , ( ) => {
71
95
const testCases = [
72
96
{
0 commit comments