From d5b373df483fd242ba1a18636d5bf2b3c0c9a9e9 Mon Sep 17 00:00:00 2001 From: Ayo Ayco Date: Sun, 10 Nov 2024 20:05:39 +0100 Subject: [PATCH] test(sanitizer): add tests for cozify() --- src/utils/sanitizer.test.ts | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/utils/sanitizer.test.ts diff --git a/src/utils/sanitizer.test.ts b/src/utils/sanitizer.test.ts new file mode 100644 index 0000000..30cfe6e --- /dev/null +++ b/src/utils/sanitizer.test.ts @@ -0,0 +1,31 @@ +import { describe, expect, test } from "vitest"; +import { cozify } from "./sanitizer"; + +describe("cozify()", async () => { + const baseUrl = "https://cozy.pub"; + + test("should remove scripts", async () => { + const html = "

HELLO

"; + const result = await cozify(html, baseUrl); + expect(result).not.toContain("