Skip to content

Commit

Permalink
Add XML parsing error test
Browse files Browse the repository at this point in the history
  • Loading branch information
ogonkov committed Sep 1, 2020
1 parent 87617c6 commit e0ad29f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/fixtures/invalid.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<fest:template xmlns:fest="http://fest.mail.ru" context_name="json">
Broken XML syntax

<fest:script>
var c = a && b;
</fest:script>
</fest:template>
8 changes: 8 additions & 0 deletions test/loader.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,12 @@ describe('dependencies parse', function() {
expect.stringMatching('script.js')
);
});

test('should log parsing warnings', async function() {
const stats = await compiler('fixtures/invalid.xml');

expect(stats.toJson().warnings).toEqual(expect.arrayContaining([
expect.stringMatching('Invalid character in entity name')
]));
});
});

0 comments on commit e0ad29f

Please sign in to comment.