import { describe, expect, it } from "vitest"; import { buildArtifactSrcdoc, buildDeployableHtml, isDeployableKind, } from "$lib/utils/previewSrcdoc"; import { BADGE_HOST_ATTRIBUTE } from "$lib/utils/deployBadge"; /** Drop the injected badge script so the rest of the document can be compared. */ function stripBadge(html: string): string { return html.replace(/\n` terminated the artifact's // script — breaking the page *and* losing the badge. it("never injects into a trailing script that mentions a closing body tag", () => { const doc = `