File tree Expand file tree Collapse file tree 2 files changed +13
-13
lines changed
tests/integration/tools/mongodb/metadata Expand file tree Collapse file tree 2 files changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -27,18 +27,18 @@ describe("Connect tool", () => {
2727 } ) ;
2828
2929 it ( "should have correct metadata" , async ( ) => {
30- const tools = await client . listTools ( ) ;
31- const connectTool = tools . tools . find ( ( tool ) => tool . name === "connect" ) ;
30+ const { tools } = await client . listTools ( ) ;
31+ const connectTool = tools . find ( ( tool ) => tool . name === "connect" ) ! ;
3232 expect ( connectTool ) . toBeDefined ( ) ;
33- expect ( connectTool ! . description ) . toBe ( "Connect to a MongoDB instance" ) ;
34- expect ( connectTool ! . inputSchema . type ) . toBe ( "object" ) ;
35- expect ( connectTool ! . inputSchema . properties ) . toBeDefined ( ) ;
33+ expect ( connectTool . description ) . toBe ( "Connect to a MongoDB instance" ) ;
34+ expect ( connectTool . inputSchema . type ) . toBe ( "object" ) ;
35+ expect ( connectTool . inputSchema . properties ) . toBeDefined ( ) ;
3636
37- const propertyNames = Object . keys ( connectTool ! . inputSchema . properties ! ) ;
37+ const propertyNames = Object . keys ( connectTool . inputSchema . properties ! ) ;
3838 expect ( propertyNames ) . toHaveLength ( 1 ) ;
3939 expect ( propertyNames [ 0 ] ) . toBe ( "connectionStringOrClusterName" ) ;
4040
41- const connectionStringOrClusterNameProp = connectTool ! . inputSchema . properties ! [ propertyNames [ 0 ] ] as {
41+ const connectionStringOrClusterNameProp = connectTool . inputSchema . properties ! [ propertyNames [ 0 ] ] as {
4242 type : string ;
4343 description : string ;
4444 } ;
Original file line number Diff line number Diff line change @@ -27,14 +27,14 @@ describe("listDatabases tool", () => {
2727 } ) ;
2828
2929 it ( "should have correct metadata" , async ( ) => {
30- const tools = await client . listTools ( ) ;
31- const listDatabases = tools . tools . find ( ( tool ) => tool . name === "list-databases" ) ;
30+ const { tools } = await client . listTools ( ) ;
31+ const listDatabases = tools . find ( ( tool ) => tool . name === "list-databases" ) ! ;
3232 expect ( listDatabases ) . toBeDefined ( ) ;
33- expect ( listDatabases ! . description ) . toBe ( "List all databases for a MongoDB connection" ) ;
34- expect ( listDatabases ! . inputSchema . type ) . toBe ( "object" ) ;
35- expect ( listDatabases ! . inputSchema . properties ) . toBeDefined ( ) ;
33+ expect ( listDatabases . description ) . toBe ( "List all databases for a MongoDB connection" ) ;
34+ expect ( listDatabases . inputSchema . type ) . toBe ( "object" ) ;
35+ expect ( listDatabases . inputSchema . properties ) . toBeDefined ( ) ;
3636
37- const propertyNames = Object . keys ( listDatabases ! . inputSchema . properties ! ) ;
37+ const propertyNames = Object . keys ( listDatabases . inputSchema . properties ! ) ;
3838 expect ( propertyNames ) . toHaveLength ( 0 ) ;
3939 } ) ;
4040
You can’t perform that action at this time.
0 commit comments