Skip to content

Commit

Permalink
Implement ava tests for the escape option
Browse files Browse the repository at this point in the history
  • Loading branch information
halbgut committed Apr 19, 2016
1 parent 5234c67 commit e4f8bd4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/xml.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,8 @@ test('xml declaration options', t => {
t.is(xml([{a: 'test'}], {declaration: true, indent: '\n'}), '<?xml version="1.0" encoding="UTF-8"?>\n<a>test</a>');
t.is(xml([{a: 'test'}], {}), '<a>test</a>');
});

test('escape option', t => {
t.is(xml([ { x: '<a>test</a>' } ], { escape: false }), '<x><a>test</a></x>');
t.is(xml([ { x: [ { _attr: { a: 'x' } }, '<a>test</a>' ] } ], { escape: false }), '<x a="x"><a>test</a></x>');
});

0 comments on commit e4f8bd4

Please sign in to comment.