import { readFileSync, existsSync } from "node:fs"; import { resolve } from "node:path"; import { describe, it, expect } from "vitest"; const PLUGIN_ROOT = resolve(__dirname, ".."); describe("plugin.json", () => { const pluginPath = resolve(PLUGIN_ROOT, ".claude-plugin/plugin.json"); it("exists", () => { expect(existsSync(pluginPath)).toBe(true); }); it("is valid JSON with required fields", () => { const raw = readFileSync(pluginPath, "utf-8"); const manifest = JSON.parse(raw); expect(manifest.name).toBe("fathom"); expect(manifest.description).toBeTypeOf("string"); expect(manifest.description.length).toBeGreaterThan(0); expect(manifest.version).toMatch(/^\d+\.\d+\.\d+$/); expect(manifest.author?.name).toBeTypeOf("string"); expect(manifest.license).toBeTypeOf("string"); }); }); describe(".mcp.json", () => { const mcpPath = resolve(PLUGIN_ROOT, ".mcp.json"); it("exists", () => { expect(existsSync(mcpPath)).toBe(true); }); it("is valid JSON with fathom MCP server config", () => { const raw = readFileSync(mcpPath, "utf-8"); const config = JSON.parse(raw); expect(config.mcpServers.fathom.command).toBe("npx"); expect(config.mcpServers.fathom.args).toBeInstanceOf(Array); expect(config.mcpServers.fathom.args).toContain("fathom-token-mcp@latest"); expect(config.mcpServers.fathom.args).toContain("--project-dir"); }); }); describe("directory structure", () => { it("skills directory exists", () => { expect(existsSync(resolve(PLUGIN_ROOT, "skills"))).toBe(true); }); });