import { describe, expect, test } from "bun:test"; import { escapeHtml } from "../../src/lib/html.ts"; describe("escapeHtml", () => { test('escapes & < > "', () => { expect(escapeHtml('a & b < c > d "e"')).toBe( "a & b < c > d "e"", ); }); test("returns empty string unchanged", () => { expect(escapeHtml("")).toBe(""); }); test("leaves safe text unchanged", () => { expect(escapeHtml("hello world 123")).toBe("hello world 123"); }); test("handles string with only special characters", () => { expect(escapeHtml('<"&">')).toBe("<"&">"); }); });