import { describe, expect, it } from "vitest"; import { extractHtml, previewHtml } from "../extract-html"; describe("extractHtml", () => { it("extracts fenced HTML", () => { expect(extractHtml("```html\nok\n```")).toBe( "ok", ); }); it("extracts a full document from chatty output", () => { const source = "Here you go:\nok\nDone."; expect(extractHtml(source)).toBe("ok"); }); it("wraps plain text in a previewable scaffold", () => { const html = extractHtml("hello "); expect(html).toContain(""); expect(html).toContain("hello <world>"); }); }); describe("previewHtml", () => { it("closes partial streamed HTML for iframe rendering", () => { expect(previewHtml("
streaming")).toContain("\n"); }); });