UNPKG

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