Skip to content

Commit 491a8dc

Browse files
committed
Add separate tool tests
1 parent 6ce4a0b commit 491a8dc

File tree

3 files changed

+612
-61
lines changed

3 files changed

+612
-61
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ client/tsconfig.app.tsbuildinfo
99
client/tsconfig.node.tsbuildinfo
1010
cli/build
1111
test-output
12+
tool-test-output
1213
# symlinked by `npm run link:sdk`:
1314
sdk
1415
client/playwright-report/

cli/scripts/cli-tests.js

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ console.log(`${colors.BLUE}- Environment variables (-e)${colors.NC}`);
3737
console.log(`${colors.BLUE}- Config file (--config)${colors.NC}`);
3838
console.log(`${colors.BLUE}- Server selection (--server)${colors.NC}`);
3939
console.log(`${colors.BLUE}- Method selection (--method)${colors.NC}`);
40-
console.log(
41-
`${colors.BLUE}- Tool-related options (--tool-name, --tool-arg)${colors.NC}`,
42-
);
4340
console.log(`${colors.BLUE}- Resource-related options (--uri)${colors.NC}`);
4441
console.log(
4542
`${colors.BLUE}- Prompt-related options (--prompt-name, --prompt-args)${colors.NC}`,
@@ -454,64 +451,6 @@ async function runTests() {
454451
"tools/list",
455452
);
456453

457-
console.log(
458-
`\n${colors.YELLOW}=== Running Tool-Related Tests ===${colors.NC}`,
459-
);
460-
461-
// Test 12: CLI mode with tool call
462-
await runBasicTest(
463-
"tool_call",
464-
TEST_CMD,
465-
...TEST_ARGS,
466-
"--cli",
467-
"--method",
468-
"tools/call",
469-
"--tool-name",
470-
"echo",
471-
"--tool-arg",
472-
"message=Hello",
473-
);
474-
475-
// Test 13: CLI mode with tool call but missing tool name (should fail)
476-
await runErrorTest(
477-
"missing_tool_name",
478-
TEST_CMD,
479-
...TEST_ARGS,
480-
"--cli",
481-
"--method",
482-
"tools/call",
483-
"--tool-arg",
484-
"message=Hello",
485-
);
486-
487-
// Test 14: CLI mode with tool call but invalid tool args format (should fail)
488-
await runErrorTest(
489-
"invalid_tool_args",
490-
TEST_CMD,
491-
...TEST_ARGS,
492-
"--cli",
493-
"--method",
494-
"tools/call",
495-
"--tool-name",
496-
"echo",
497-
"--tool-arg",
498-
"invalid_format",
499-
);
500-
501-
// Test 15: CLI mode with multiple tool args
502-
await runBasicTest(
503-
"multiple_tool_args",
504-
TEST_CMD,
505-
...TEST_ARGS,
506-
"--cli",
507-
"--method",
508-
"tools/call",
509-
"--tool-name",
510-
"add",
511-
"--tool-arg",
512-
"a=1",
513-
"b=2",
514-
);
515454

516455
console.log(
517456
`\n${colors.YELLOW}=== Running Resource-Related Tests ===${colors.NC}`,

0 commit comments

Comments
 (0)