html-entities-decode
Version:
Fast function for decoding HTML entities.
39 lines (29 loc) • 874 B
JavaScript
/* IMPORT */
import {describe} from 'ava-spec';
import decode from '../dist';
/* HTML ENTITIES DECODE */
describe ( 'decode', it => {
it ( 'works', t => {
const tests = [
['&foo;', '&foo;'],
['&', '&'],
['&', '&'],
['&', '&'],
['&', '&'],
['&', '&'],
['&', '&'],
['&', '&'],
['&', '&'],
['&', '&'],
['&', '&'],
[':', ':'],
[':', ':'],
[':', ':'],
[':', ':'],
['asdf & ÿ ü '', 'asdf & ÿ ü \''],
['&', '&'],
['Foo © bar 𝌆 baz ☃ qux', 'Foo © bar 𝌆 baz ☃ qux']
];
tests.forEach ( ([ encoded, decoded ]) => t.is ( decode ( encoded ), decoded ) );
});
});