import { describe, expect, it } from "vitest"; import { serializeForScript } from "./safe-json"; const LINE_SEPARATOR = String.fromCharCode(0x2028); // U+2028 const PARAGRAPH_SEPARATOR = String.fromCharCode(0x2029); // U+2029 describe("serializeForScript", () => { it("neutralizes a breakout so the script tag is not terminated early", () => { // Given const value = { sentryDsn: "" }; // When const serialized = serializeForScript(value); // Then expect(serialized).not.toContain(""); expect(serialized).not.toContain("<"); expect(serialized).not.toContain(">"); }); it("neutralizes the HTML comment opener " }; // When const serialized = serializeForScript(value); // Then expect(serialized).not.toContain("