import { readFileSync } from "node:fs" import { join } from "node:path" import { describe, expect, it } from "vitest" // The MCP preview page, as the server fills it in, with its script run in // this document (no session id, so it does not poll) const dir = join(process.cwd(), "packages/mcp-server/src/preview") const html = readFileSync(join(dir, "index.html"), "utf8") .replace("{{CSS}}", "") .replace("{{SESSION_BADGE}}", "") .replaceAll("{{DISABLED}}", "") .replace("{{DRAWIO_URL}}", "about:blank") .replace("{{SESSION_JSON}}", '""') .replace("{{ORIGIN_JSON}}", '"https://embed.diagrams.net"') const scripts = [...html.matchAll(/