mirror of
https://github.com/nolanlawson/pinafore
synced 2024-12-11 09:45:24 +01:00
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'
|
||
|
||
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 �')
|
||
})
|
||
})
|