Files
SnowLuma/.pnpm-store/v11/files/61/0baabdfd8829f73e6679f2a04e5d4cd3222b5eaa81c551a8ee553ad000403bb6a814c308c17958205c0ee96741bc78c490c4c976aae1f89e82d6ec011c8678
T
TanTan 2a69b23b47
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

15 lines
497 B
Plaintext

import { describe, it, expect } from "vitest";
import * as entities from "./index.js";
describe("escape HTML", () => {
it("should escape HTML attribute values", () =>
expect(entities.escapeAttribute('<a " attr > & value \u00A0!')).toBe(
"<a &quot; attr > &amp; value &nbsp;!",
));
it("should escape HTML text", () =>
expect(entities.escapeText('<a " text > & value \u00A0!')).toBe(
'&lt;a " text &gt; &amp; value &nbsp;!',
));
});