Handle capabilities checks at the request() level, make non-strict by default
This commit is contained in:
parent
8e369b7171
commit
dc45f5d148
1 changed files with 254 additions and 83 deletions
|
|
@ -46,7 +46,9 @@ test("should initialize with matching protocol version", async () => {
|
|||
version: "1.0",
|
||||
},
|
||||
{
|
||||
sampling: {},
|
||||
capabilities: {
|
||||
sampling: {},
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
|
|
@ -93,7 +95,9 @@ test("should initialize with supported older protocol version", async () => {
|
|||
version: "1.0",
|
||||
},
|
||||
{
|
||||
sampling: {},
|
||||
capabilities: {
|
||||
sampling: {},
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
|
|
@ -135,7 +139,9 @@ test("should reject unsupported protocol version", async () => {
|
|||
version: "1.0",
|
||||
},
|
||||
{
|
||||
sampling: {},
|
||||
capabilities: {
|
||||
sampling: {},
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
|
|
@ -153,8 +159,10 @@ test("should respect server capabilities", async () => {
|
|||
version: "1.0",
|
||||
},
|
||||
{
|
||||
resources: {},
|
||||
tools: {},
|
||||
capabilities: {
|
||||
resources: {},
|
||||
tools: {},
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
|
|
@ -187,7 +195,10 @@ test("should respect server capabilities", async () => {
|
|||
version: "1.0",
|
||||
},
|
||||
{
|
||||
sampling: {},
|
||||
capabilities: {
|
||||
sampling: {},
|
||||
},
|
||||
enforceStrictCapabilities: true,
|
||||
},
|
||||
);
|
||||
|
||||
|
|
@ -263,7 +274,9 @@ test("should typecheck", () => {
|
|||
version: "1.0.0",
|
||||
},
|
||||
{
|
||||
sampling: {},
|
||||
capabilities: {
|
||||
sampling: {},
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue