diff --git a/packages/agent-core-v2/test/mcpCore/stubs.ts b/packages/agent-core-v2/test/mcpCore/stubs.ts index 2e11f25c74..da3caee483 100644 --- a/packages/agent-core-v2/test/mcpCore/stubs.ts +++ b/packages/agent-core-v2/test/mcpCore/stubs.ts @@ -1,6 +1,7 @@ import { randomUUID } from 'node:crypto'; import { createServer, type Server } from 'node:http'; import type { AddressInfo } from 'node:net'; +import { fileURLToPath } from 'node:url'; import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; import { SSEServerTransport } from '@modelcontextprotocol/sdk/server/sse.js'; @@ -17,26 +18,26 @@ import type { ToolExecution, } from '#/tool/toolContract'; -export const fixturesDir = new URL('./fixtures/', import.meta.url).pathname; -export const stdioFixture = new URL('./fixtures/mock-stdio-server.mjs', import.meta.url).pathname; -export const cwdStdioFixture = new URL('./fixtures/cwd-stdio-server.mjs', import.meta.url).pathname; -export const slowStdioFixture = new URL('./fixtures/slow-stdio-server.mjs', import.meta.url).pathname; -export const slowToolStdioFixture = new URL( - './fixtures/slow-tool-stdio-server.mjs', - import.meta.url, -).pathname; -export const hangingListStdioFixture = new URL( - './fixtures/hanging-list-stdio-server.mjs', - import.meta.url, -).pathname; -export const crashAfterConnectFixture = new URL( - './fixtures/crash-after-connect-stdio-server.mjs', - import.meta.url, -).pathname; -export const stderrThenExitFixture = new URL( - './fixtures/stderr-then-exit-stdio-server.mjs', - import.meta.url, -).pathname; +export const fixturesDir = fileURLToPath(new URL('./fixtures/', import.meta.url)); +export const stdioFixture = fileURLToPath(new URL('./fixtures/mock-stdio-server.mjs', import.meta.url)); +export const cwdStdioFixture = fileURLToPath( + new URL('./fixtures/cwd-stdio-server.mjs', import.meta.url), +); +export const slowStdioFixture = fileURLToPath( + new URL('./fixtures/slow-stdio-server.mjs', import.meta.url), +); +export const slowToolStdioFixture = fileURLToPath( + new URL('./fixtures/slow-tool-stdio-server.mjs', import.meta.url), +); +export const hangingListStdioFixture = fileURLToPath( + new URL('./fixtures/hanging-list-stdio-server.mjs', import.meta.url), +); +export const crashAfterConnectFixture = fileURLToPath( + new URL('./fixtures/crash-after-connect-stdio-server.mjs', import.meta.url), +); +export const stderrThenExitFixture = fileURLToPath( + new URL('./fixtures/stderr-then-exit-stdio-server.mjs', import.meta.url), +); export function createMemoryMcpOAuthStore(): McpOAuthStore { const data = new Map();