fix: Ensure the correct capability is checked for completion/complete
This commit is contained in:
parent
e2ab858308
commit
87dc5eb4a2
1 changed files with 12 additions and 3 deletions
|
|
@ -227,10 +227,19 @@ test("should respect server capabilities", async () => {
|
|||
await expect(client.listResources()).resolves.not.toThrow();
|
||||
await expect(client.listTools()).resolves.not.toThrow();
|
||||
|
||||
// This should throw because prompts are not supported
|
||||
// These should throw because prompts, logging, and completions are not supported
|
||||
await expect(client.listPrompts()).rejects.toThrow(
|
||||
"Server does not support prompts",
|
||||
);
|
||||
await expect(client.setLoggingLevel("error")).rejects.toThrow(
|
||||
"Server does not support logging",
|
||||
);
|
||||
await expect(
|
||||
client.complete({
|
||||
ref: { type: "ref/prompt", name: "test" },
|
||||
argument: { name: "test", value: "test" },
|
||||
}),
|
||||
).rejects.toThrow("Server does not support completions");
|
||||
});
|
||||
|
||||
test("should respect client notification capabilities", async () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue