File tree 2 files changed +12
-3
lines changed
2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -227,10 +227,19 @@ test("should respect server capabilities", async () => {
227
227
await expect ( client . listResources ( ) ) . resolves . not . toThrow ( ) ;
228
228
await expect ( client . listTools ( ) ) . resolves . not . toThrow ( ) ;
229
229
230
- // This should throw because prompts are not supported
230
+ // These should throw because prompts, logging, and completions are not supported
231
231
await expect ( client . listPrompts ( ) ) . rejects . toThrow (
232
232
"Server does not support prompts" ,
233
233
) ;
234
+ await expect ( client . setLoggingLevel ( "error" ) ) . rejects . toThrow (
235
+ "Server does not support logging" ,
236
+ ) ;
237
+ await expect (
238
+ client . complete ( {
239
+ ref : { type : "ref/prompt" , name : "test" } ,
240
+ argument : { name : "test" , value : "test" } ,
241
+ } ) ,
242
+ ) . rejects . toThrow ( "Server does not support completions" ) ;
234
243
} ) ;
235
244
236
245
test ( "should respect client notification capabilities" , async ( ) => {
Original file line number Diff line number Diff line change @@ -237,9 +237,9 @@ export class Client<
237
237
break ;
238
238
239
239
case "completion/complete" :
240
- if ( ! this . _serverCapabilities ?. prompts ) {
240
+ if ( ! this . _serverCapabilities ?. completions ) {
241
241
throw new Error (
242
- `Server does not support prompts (required for ${ method } )` ,
242
+ `Server does not support completions (required for ${ method } )` ,
243
243
) ;
244
244
}
245
245
break ;
You can’t perform that action at this time.
0 commit comments