Something went wrong. Try again.
🌿 Collaborative wiki on ATProto forked from juprodh.me/lichen.wiki
Something went wrong. Try again.
1234567891011121314151617181920212223import { 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("<"&">"); });});