test: clean up integration test by removing unnecessary console logs

This commit is contained in:
mingholy.lmh
2025-12-05 22:11:27 +08:00
parent 96d458fa8c
commit 22943b888d

View File

@@ -51,12 +51,6 @@ describe('SDK MCP Server Integration (E2E)', () => {
describe('Basic SDK MCP Tool Usage', () => { describe('Basic SDK MCP Tool Usage', () => {
it('should use SDK MCP tool to perform a simple calculation', async () => { it('should use SDK MCP tool to perform a simple calculation', async () => {
// Define a simple calculator tool using the tool() API with Zod schema // Define a simple calculator tool using the tool() API with Zod schema
console.log(
z.object({
a: z.number().describe('First number'),
b: z.number().describe('Second number'),
}),
);
const calculatorTool = tool( const calculatorTool = tool(
'calculate_sum', 'calculate_sum',
'Calculate the sum of two numbers', 'Calculate the sum of two numbers',
@@ -82,7 +76,6 @@ describe('SDK MCP Server Integration (E2E)', () => {
options: { options: {
...SHARED_TEST_OPTIONS, ...SHARED_TEST_OPTIONS,
cwd: testDir, cwd: testDir,
stderr: (message) => console.error(message),
mcpServers: { mcpServers: {
'sdk-calculator': serverConfig, 'sdk-calculator': serverConfig,
}, },
@@ -96,7 +89,6 @@ describe('SDK MCP Server Integration (E2E)', () => {
try { try {
for await (const message of q) { for await (const message of q) {
messages.push(message); messages.push(message);
console.log(JSON.stringify(message, null, 2));
if (isSDKAssistantMessage(message)) { if (isSDKAssistantMessage(message)) {
const toolUseBlocks = findToolUseBlocks(message, 'calculate_sum'); const toolUseBlocks = findToolUseBlocks(message, 'calculate_sum');
@@ -172,7 +164,6 @@ describe('SDK MCP Server Integration (E2E)', () => {
assistantText += extractText(message.message.content); assistantText += extractText(message.message.content);
} }
} }
console.log(JSON.stringify(messages, null, 2));
// Validate tool was called // Validate tool was called
expect(foundToolUse).toBe(true); expect(foundToolUse).toBe(true);