})
describe('decodeEntities option', () => {
- test.skip('use default map', () => {
+ test('use decode by default', () => {
const ast: any = baseParse('><&'"&foo;')
expect(ast.children.length).toBe(1)
expect(ast.children[0].content).toBe('><&\'"&foo;')
})
- test.skip('use the given map', () => {
- const ast: any = baseParse('&∪︀', {
+ test('should warn in non-browser build', () => {
+ baseParse('&∪︀', {
decodeEntities: text => text.replace('∪︀', '\u222A\uFE00'),
onError: () => {} // Ignore errors
})
-
- expect(ast.children.length).toBe(1)
- expect(ast.children[0].type).toBe(NodeTypes.TEXT)
- expect(ast.children[0].content).toBe('&\u222A\uFE00')
+ expect(
+ `decodeEntities option is passed but will be ignored`
+ ).toHaveBeenWarned()
})
})