shunter
Version:
A Node.js application built to read JSON and translate it into HTML
18 lines (14 loc) • 613 B
JavaScript
'use strict';
var assert = require('proclaim');
var helper = require('../../helpers/template.js')();
describe('Dust Filter: html', function () {
it('Should safely escape HTML entities', function (done) {
helper.render('{test1|s|html} {test2|s|html}', {
test1: '<script>alert("foo") && alert(\'bar\');</script>',
test2: '舒 & && < >>> " < >'
}, function (err, dom, str) {
assert.strictEqual(str, '<script>alert("foo") && alert('bar');</script> 舒 & && < >>> " < >');
done();
});
});
});