diff --git a/test/index.spec.mjs b/test/index.spec.mjs index 1029fd5..2d4eae0 100644 --- a/test/index.spec.mjs +++ b/test/index.spec.mjs @@ -15,6 +15,17 @@ function formatHtml(html) { .replace(/\r\n/g, "\n"); } +test("should sanitise html", (t) => { + const $ = parse( + '
first
Bad body
second
', + ); + + t.is( + $.outerHtml(), + '
first
Bad body
second
', + ); +}); + test("should not change the original html structure", (t) => { const jqueryHtml = fs.readFileSync(path.resolve(__dirname, "jquery.html"), { encoding: "utf8",