Skip to content

Commit 9d00b6d

Browse files
committed
chore: add unit tests
1 parent a0ffc1d commit 9d00b6d

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

__tests__/sanitize.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,4 +400,13 @@ b {background: red;}</style>`);
400400
),
401401
).toBe(`<style></style>`);
402402
});
403+
404+
// https://github.com/mat-sz/lettersanitizer/pull/10
405+
// https://github.com/mat-sz/lettersanitizer/security/advisories/GHSA-hhw2-373g-hx77
406+
it("doesn't crash with certain markups", () => {
407+
const depth = 25;
408+
const html =
409+
'<article>'.repeat(depth) + 'Hello, world.' + '</article>'.repeat(depth);
410+
expect(() => sanitize(html)).not.toThrow();
411+
});
403412
});

0 commit comments

Comments
 (0)