Skip to content

Commit d9f2c61

Browse files
committed
Changed all test tools to snake case, cleaned up console logging in test, fixed sandbox message on startup. Removed test:unit, made test target run prettier-check and all tests.
1 parent 2ab3c54 commit d9f2c61

11 files changed

Lines changed: 288 additions & 274 deletions

cli/__tests__/cli.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ describe("CLI Tests", () => {
3939
// Validate expected tools from test-mcp-server
4040
const toolNames = json.tools.map((tool: any) => tool.name);
4141
expect(toolNames).toContain("echo");
42-
expect(toolNames).toContain("get-sum");
43-
expect(toolNames).toContain("get-annotated-message");
42+
expect(toolNames).toContain("get_sum");
43+
expect(toolNames).toContain("get_annotated_message");
4444
});
4545

4646
it("should fail with nonexistent method", async () => {
@@ -315,7 +315,7 @@ describe("CLI Tests", () => {
315315
"--method",
316316
"prompts/get",
317317
"--prompt-name",
318-
"simple-prompt",
318+
"simple_prompt",
319319
]);
320320

321321
expectCliSuccess(result);
@@ -340,7 +340,7 @@ describe("CLI Tests", () => {
340340
"--method",
341341
"prompts/get",
342342
"--prompt-name",
343-
"args-prompt",
343+
"args_prompt",
344344
"--prompt-args",
345345
"city=New York",
346346
"state=NY",

cli/__tests__/tools.test.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ describe("Tool Tests", () => {
3131
// Validate expected tools from test-mcp-server
3232
const toolNames = json.tools.map((tool: any) => tool.name);
3333
expect(toolNames).toContain("echo");
34-
expect(toolNames).toContain("get-sum");
35-
expect(toolNames).toContain("get-annotated-message");
34+
expect(toolNames).toContain("get_sum");
35+
expect(toolNames).toContain("get_annotated_message");
3636
});
3737
});
3838

@@ -69,7 +69,7 @@ describe("Tool Tests", () => {
6969
"--method",
7070
"tools/call",
7171
"--tool-name",
72-
"get-sum",
72+
"get_sum",
7373
"--tool-arg",
7474
"a=42",
7575
"b=58",
@@ -95,7 +95,7 @@ describe("Tool Tests", () => {
9595
"--method",
9696
"tools/call",
9797
"--tool-name",
98-
"get-sum",
98+
"get_sum",
9999
"--tool-arg",
100100
"a=19.99",
101101
"b=20.01",
@@ -121,7 +121,7 @@ describe("Tool Tests", () => {
121121
"--method",
122122
"tools/call",
123123
"--tool-name",
124-
"get-annotated-message",
124+
"get_annotated_message",
125125
"--tool-arg",
126126
"messageType=success",
127127
"includeImage=true",
@@ -146,7 +146,7 @@ describe("Tool Tests", () => {
146146
"--method",
147147
"tools/call",
148148
"--tool-name",
149-
"get-annotated-message",
149+
"get_annotated_message",
150150
"--tool-arg",
151151
"messageType=error",
152152
"includeImage=false",
@@ -195,7 +195,7 @@ describe("Tool Tests", () => {
195195
"--method",
196196
"tools/call",
197197
"--tool-name",
198-
"get-sum",
198+
"get_sum",
199199
"--tool-arg",
200200
"a=42.5",
201201
"b=57.5",
@@ -421,7 +421,7 @@ describe("Tool Tests", () => {
421421
"--method",
422422
"prompts/get",
423423
"--prompt-name",
424-
"args-prompt",
424+
"args_prompt",
425425
"--prompt-args",
426426
"city=New York",
427427
"state=NY",
@@ -441,7 +441,7 @@ describe("Tool Tests", () => {
441441
});
442442

443443
it("should handle prompt with simple arguments", async () => {
444-
// Note: simple-prompt doesn't accept arguments, but the CLI should still
444+
// Note: simple_prompt doesn't accept arguments, but the CLI should still
445445
// accept the command and the server should ignore the arguments
446446
const { command, args } = getTestMcpServerCommand();
447447
const result = await runCli([
@@ -451,7 +451,7 @@ describe("Tool Tests", () => {
451451
"--method",
452452
"prompts/get",
453453
"--prompt-name",
454-
"simple-prompt",
454+
"simple_prompt",
455455
"--prompt-args",
456456
"name=test",
457457
"count=5",
@@ -464,7 +464,7 @@ describe("Tool Tests", () => {
464464
expect(json.messages.length).toBeGreaterThan(0);
465465
expect(json.messages[0]).toHaveProperty("content");
466466
expect(json.messages[0].content).toHaveProperty("type", "text");
467-
// test-mcp-server's simple-prompt returns standard message (ignoring args)
467+
// test-mcp-server's simple_prompt returns standard message (ignoring args)
468468
expect(json.messages[0].content.text).toBe(
469469
"This is a simple prompt for testing purposes.",
470470
);
@@ -503,7 +503,7 @@ describe("Tool Tests", () => {
503503
"--method",
504504
"tools/call",
505505
"--tool-name",
506-
"get-sum",
506+
"get_sum",
507507
"--tool-arg",
508508
"a=10",
509509
"b=20",

0 commit comments

Comments
 (0)