UNPKG

713 BJavaScriptView Raw
1/*eslint func-names: 0*/
2/*global describe, it */
3
4var helper = require('../lib/helper')
5;
6
7require('chai').should();
8
9describe('helper.escape()', function() {
10 it('should not escape normal stuff', function() {
11 helper.escape('x y').should.equal('x y');
12 });
13
14 it('should escape the ampersand', function() {
15 helper.escape('x & y').should.equal('x & y');
16 });
17
18 it('should escape the greater-than', function() {
19 helper.escape('x > y').should.equal('x > y');
20 });
21
22 it('should escape the less-than', function() {
23 helper.escape('x < y').should.equal('x &lt; y');
24 });
25
26 it('should escape the double-quote', function() {
27 helper.escape('x " y').should.equal('x &quot; y');
28 });
29});