mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
test: clean up integration test by removing unnecessary console logs
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user