Skip to content

Commit b1bb528

Browse files
Update test
1 parent 387098c commit b1bb528

File tree

1 file changed

+7
-33
lines changed

1 file changed

+7
-33
lines changed

src/server/mcp.test.ts

Lines changed: 7 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -937,24 +937,6 @@ describe("tool()", () => {
937937
}),
938938
);
939939

940-
mcpServer.registerTool(
941-
"test (new api)",
942-
{
943-
inputSchema: {
944-
name: z.string(),
945-
value: z.number(),
946-
},
947-
},
948-
async ({ name, value }) => ({
949-
content: [
950-
{
951-
type: "text",
952-
text: `${name}: ${value}`,
953-
},
954-
],
955-
})
956-
);
957-
958940
const [clientTransport, serverTransport] =
959941
InMemoryTransport.createLinkedPair();
960942

@@ -977,23 +959,15 @@ describe("tool()", () => {
977959
},
978960
CallToolResultSchema,
979961
),
980-
).rejects.toThrow(/Invalid arguments/);
981-
982-
await expect(
983-
client.request(
962+
).resolves.toStrictEqual({
963+
content: [
984964
{
985-
method: "tools/call",
986-
params: {
987-
name: "test (new api)",
988-
arguments: {
989-
name: "test",
990-
value: "not a number",
991-
},
992-
},
965+
type: "text",
966+
text: expect.stringMatching(/Invalid arguments for tool test/),
993967
},
994-
CallToolResultSchema,
995-
),
996-
).rejects.toThrow(/Invalid arguments/);
968+
],
969+
isError: true,
970+
});
997971
});
998972

999973
/***

0 commit comments

Comments
 (0)