11import type {
2- ConnectionManagerEvents ,
2+ MCPConnectionManagerEvents ,
33 ConnectionStateConnected ,
44 ConnectionStringAuthType ,
5- } from "../../../src/common/connectionManager .js" ;
6- import { ConnectionManager } from "../../../src/common/connectionManager .js" ;
5+ } from "../../../src/common/mcpConnectionManager .js" ;
6+ import { MCPConnectionManager } from "../../../src/common/mcpConnectionManager .js" ;
77import type { UserConfig } from "../../../src/common/config.js" ;
88import { describeWithMongoDB } from "../tools/mongodb/mongodbHelpers.js" ;
99import { describe , beforeEach , expect , it , vi , afterEach } from "vitest" ;
1010
1111describeWithMongoDB ( "Connection Manager" , ( integration ) => {
12- function connectionManager ( ) : ConnectionManager {
12+ function connectionManager ( ) : MCPConnectionManager {
1313 return integration . mcpServer ( ) . session . connectionManager ;
1414 }
1515
@@ -24,11 +24,11 @@ describeWithMongoDB("Connection Manager", (integration) => {
2424
2525 describe ( "when successfully connected" , ( ) => {
2626 type ConnectionManagerSpies = {
27- "connection-requested" : ( event : ConnectionManagerEvents [ "connection-requested" ] [ 0 ] ) => void ;
28- "connection-succeeded" : ( event : ConnectionManagerEvents [ "connection-succeeded" ] [ 0 ] ) => void ;
29- "connection-timed-out" : ( event : ConnectionManagerEvents [ "connection-timed-out" ] [ 0 ] ) => void ;
30- "connection-closed" : ( event : ConnectionManagerEvents [ "connection-closed" ] [ 0 ] ) => void ;
31- "connection-errored" : ( event : ConnectionManagerEvents [ "connection-errored" ] [ 0 ] ) => void ;
27+ "connection-requested" : ( event : MCPConnectionManagerEvents [ "connection-requested" ] [ 0 ] ) => void ;
28+ "connection-succeeded" : ( event : MCPConnectionManagerEvents [ "connection-succeeded" ] [ 0 ] ) => void ;
29+ "connection-timed-out" : ( event : MCPConnectionManagerEvents [ "connection-timed-out" ] [ 0 ] ) => void ;
30+ "connection-closed" : ( event : MCPConnectionManagerEvents [ "connection-closed" ] [ 0 ] ) => void ;
31+ "connection-errored" : ( event : MCPConnectionManagerEvents [ "connection-errored" ] [ 0 ] ) => void ;
3232 } ;
3333
3434 let connectionManagerSpies : ConnectionManagerSpies ;
@@ -43,7 +43,7 @@ describeWithMongoDB("Connection Manager", (integration) => {
4343 } ;
4444
4545 for ( const [ event , spy ] of Object . entries ( connectionManagerSpies ) ) {
46- connectionManager ( ) . on ( event as keyof ConnectionManagerEvents , spy ) ;
46+ connectionManager ( ) . on ( event as keyof MCPConnectionManagerEvents , spy ) ;
4747 }
4848
4949 await connectionManager ( ) . connect ( {
@@ -182,9 +182,12 @@ describe("Connection Manager connection type inference", () => {
182182
183183 for ( const { userConfig, connectionString, connectionType } of testCases ) {
184184 it ( `infers ${ connectionType } from ${ connectionString } ` , ( ) => {
185- const actualConnectionType = ConnectionManager . inferConnectionTypeFromSettings ( userConfig as UserConfig , {
186- connectionString,
187- } ) ;
185+ const actualConnectionType = MCPConnectionManager . inferConnectionTypeFromSettings (
186+ userConfig as UserConfig ,
187+ {
188+ connectionString,
189+ }
190+ ) ;
188191
189192 expect ( actualConnectionType ) . toBe ( connectionType ) ;
190193 } ) ;
0 commit comments