16e66346d7
BREAKING CHANGE: Node v12.20+, v14.14+, or v16.0+ is required * fix!: remove esm package, use native Node ES modules * fix: fix some CJS imports
24 lines
1.3 KiB
JavaScript
24 lines
1.3 KiB
JavaScript
/* global describe, it */
|
||
import assert from 'assert'
|
||
import { unescape } from '../../src/routes/_thirdparty/unescape/unescape.js'
|
||
|
||
describe('test-unescape.js', () => {
|
||
it('unescapes html correctly', () => {
|
||
assert.deepStrictEqual(unescape('What I’ve learned'), 'What I’ve learned')
|
||
assert.deepStrictEqual(unescape('Hello "world"'), 'Hello "world"')
|
||
assert.deepStrictEqual(unescape('That costs 3£ or 4€'), 'That costs 3£ or 4€')
|
||
assert.deepStrictEqual(unescape('That costs 3£ or 4€'), 'That costs 3£ or 4€') // must be lc
|
||
assert.deepStrictEqual(unescape('Foo & bar & baz'), 'Foo & bar & baz')
|
||
assert.deepStrictEqual(unescape('Winking tongue: 😜'), 'Winking tongue: 😜')
|
||
assert.deepStrictEqual(unescape('Winking tongue as hex: 😜'), 'Winking tongue as hex: 😜')
|
||
assert.deepStrictEqual(unescape('Winking tongue as hex: 😜'), 'Winking tongue as hex: 😜')
|
||
assert.deepStrictEqual(unescape('All's fair'), 'All\'s fair')
|
||
assert.deepStrictEqual(unescape('All's fair'), 'All\'s fair')
|
||
assert.deepStrictEqual(unescape('foo bar'), 'foo bar')
|
||
})
|
||
|
||
it('handles fake html code points', () => {
|
||
assert.deepStrictEqual(unescape('Hello �'), 'Hello �')
|
||
})
|
||
})
|