Skip to content

Commit 86e0c04

Browse files
committed
Fix tests
1 parent 48b4834 commit 86e0c04

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

packages/agents-core/test/mcpCache.test.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { describe, it, expect } from 'vitest';
22
import { getAllMcpTools } from '../src/mcp';
33
import { withTrace } from '../src/tracing';
4-
import { NodeMCPServerStdio } from '../src/shims/mcp-stdio/node';
4+
import { NodeMCPServerStdio } from '../src/shims/mcp-server/node';
55
import type { CallToolResultContent } from '../src/mcp';
66

77
class StubServer extends NodeMCPServerStdio {
@@ -20,7 +20,10 @@ class StubServer extends NodeMCPServerStdio {
2020
this._toolsList = this.toolList;
2121
return this.toolList;
2222
}
23-
async callTool(_toolName: string, _args: Record<string, unknown> | null): Promise<CallToolResultContent> {
23+
async callTool(
24+
_toolName: string,
25+
_args: Record<string, unknown> | null,
26+
): Promise<CallToolResultContent> {
2427
return [];
2528
}
2629
}
@@ -29,10 +32,18 @@ describe('MCP tools cache invalidation', () => {
2932
it('fetches fresh tools after cache invalidation', async () => {
3033
await withTrace('test', async () => {
3134
const toolsA = [
32-
{ name: 'a', description: '', inputSchema: { type: 'object', properties: {} } },
35+
{
36+
name: 'a',
37+
description: '',
38+
inputSchema: { type: 'object', properties: {} },
39+
},
3340
];
3441
const toolsB = [
35-
{ name: 'b', description: '', inputSchema: { type: 'object', properties: {} } },
42+
{
43+
name: 'b',
44+
description: '',
45+
inputSchema: { type: 'object', properties: {} },
46+
},
3647
];
3748
const server = new StubServer('server', toolsA);
3849

packages/agents-core/test/shims/mcp-stdio/browser.test.ts renamed to packages/agents-core/test/shims/mcp-server/browser.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, test, expect } from 'vitest';
2-
import { MCPServerStdio } from '../../../src/shims/mcp-stdio/browser';
2+
import { MCPServerStdio } from '../../../src/shims/mcp-server/browser';
33

44
describe('MCPServerStdio', () => {
55
test('should be available', async () => {

packages/agents-core/test/shims/mcp-stdio/node.test.ts renamed to packages/agents-core/test/shims/mcp-server/node.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, test, expect, vi, afterAll, beforeAll } from 'vitest';
2-
import { NodeMCPServerStdio } from '../../../src/shims/mcp-stdio/node';
2+
import { NodeMCPServerStdio } from '../../../src/shims/mcp-server/node';
33
import { TransportSendOptions } from '@modelcontextprotocol/sdk/shared/transport';
44
import { JSONRPCMessage } from '@modelcontextprotocol/sdk/types';
55

0 commit comments

Comments
 (0)