import { describe, expect, it } from "vitest"; import { serializeJsonLd } from "#lib/seo/jsonLd.ts"; describe("serializeJsonLd", () => { it("cannot close the surrounding script tag", () => { const out = serializeJsonLd({ description: "" }); expect(out).not.toMatch(/[<>]/); expect(out).toContain("\\u003c/script\\u003e"); }); it("round-trips to the same value", () => { const schema = { name: "a & b", description: "x < y > z \u2028 \u2029