Skip to content

Commit e4f8bd4

Browse files
committed
Implement ava tests for the escape option
1 parent 5234c67 commit e4f8bd4

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

test/xml.test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,3 +148,8 @@ test('xml declaration options', t => {
148148
t.is(xml([{a: 'test'}], {declaration: true, indent: '\n'}), '<?xml version="1.0" encoding="UTF-8"?>\n<a>test</a>');
149149
t.is(xml([{a: 'test'}], {}), '<a>test</a>');
150150
});
151+
152+
test('escape option', t => {
153+
t.is(xml([ { x: '<a>test</a>' } ], { escape: false }), '<x><a>test</a></x>');
154+
t.is(xml([ { x: [ { _attr: { a: 'x' } }, '<a>test</a>' ] } ], { escape: false }), '<x a="x"><a>test</a></x>');
155+
});

0 commit comments

Comments
 (0)