1 const assert
= require('assert');
2 const XSS
= require('../lib/xss');
4 describe('XSS', () => {
5 describe('sanitizeHTML', () => {
6 it('behaves consistently w.r.t. special chars used in emotes', () => {
7 const input
= '`^~=| _-,;:!?/."()[]{}@$*\\&#%+á\t';
8 const expected
= '`^~=| _-,;:!?/."()[]{}@$*\\&#%+á\t';
9 assert
.strictEqual(XSS
.sanitizeHTML(input
), expected
);
12 it('disallows iframes', () => {
13 const input
= '<iframe src="https://example.com"></iframe>';
15 assert
.strictEqual(XSS
.sanitizeHTML(input
), expected
);