Skip to main content
Glama

docs-mcp-server

fetchUrl.test.ts1.2 kB
/** Unit test for fetchUrlAction */ import { beforeEach, describe, expect, it, vi } from "vitest"; vi.mock("../../scraper/fetcher", () => ({ HttpFetcher: vi.fn().mockImplementation(() => ({})), FileFetcher: vi.fn().mockImplementation(() => ({})), AutoDetectFetcher: vi.fn().mockImplementation(() => ({ canFetch: vi.fn().mockReturnValue(true), fetch: vi.fn().mockResolvedValue({ content: "<h1>Test</h1>", mimeType: "text/html", source: "https://example.com", }), close: vi.fn().mockResolvedValue(undefined), })), })); vi.mock("../../tools", () => ({ FetchUrlTool: vi .fn() .mockImplementation(() => ({ execute: vi.fn(async () => "# md") })), })); vi.mock("../utils", () => ({ setupLogging: vi.fn(), parseHeaders: () => ({}) })); import { fetchUrlAction } from "./fetchUrl"; beforeEach(() => vi.clearAllMocks()); describe("fetchUrlAction", () => { it("executes FetchUrlTool", async () => { await fetchUrlAction("https://example.com", { followRedirects: true, scrapeMode: "auto" as any, header: [], }); const { FetchUrlTool } = await import("../../tools"); expect(FetchUrlTool).toHaveBeenCalledTimes(1); }); });

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/arabold/docs-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server