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", () => {
27
27
} ) ;
28
28
29
29
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" ) ! ;
32
32
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 ( ) ;
36
36
37
- const propertyNames = Object . keys ( connectTool ! . inputSchema . properties ! ) ;
37
+ const propertyNames = Object . keys ( connectTool . inputSchema . properties ! ) ;
38
38
expect ( propertyNames ) . toHaveLength ( 1 ) ;
39
39
expect ( propertyNames [ 0 ] ) . toBe ( "connectionStringOrClusterName" ) ;
40
40
41
- const connectionStringOrClusterNameProp = connectTool ! . inputSchema . properties ! [ propertyNames [ 0 ] ] as {
41
+ const connectionStringOrClusterNameProp = connectTool . inputSchema . properties ! [ propertyNames [ 0 ] ] as {
42
42
type : string ;
43
43
description : string ;
44
44
} ;
Original file line number Diff line number Diff line change @@ -27,14 +27,14 @@ describe("listDatabases tool", () => {
27
27
} ) ;
28
28
29
29
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" ) ! ;
32
32
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 ( ) ;
36
36
37
- const propertyNames = Object . keys ( listDatabases ! . inputSchema . properties ! ) ;
37
+ const propertyNames = Object . keys ( listDatabases . inputSchema . properties ! ) ;
38
38
expect ( propertyNames ) . toHaveLength ( 0 ) ;
39
39
} ) ;
40
40
You can’t perform that action at this time.
0 commit comments