aboutsummaryrefslogtreecommitdiff
path: root/node_modules/html-escaper/test/index.js
blob: 0eb00dee486368a3a8fbe6180ff05fd461d4b23e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
delete Object.freeze;

var html = require('../cjs');

console.assert(
  html.escape('&<>\'"') === '&amp;&lt;&gt;&#39;&quot;',
  'correct escape'
);

console.assert(
  html.escape('<>\'"&') === '&lt;&gt;&#39;&quot;&amp;',
  'correct inverted escape'
);

console.assert(
  '&<>\'"' === html.unescape('&amp;&lt;&gt;&#39;&quot;'),
  'correct unescape'
);

console.assert(
  '<>\'"&' === html.unescape('&lt;&gt;&#39;&quot;&amp;'),
  'correct inverted unescape'
);