Skip to content

Commit

Permalink
Ensure that text outside of the root el is emitted
Browse files Browse the repository at this point in the history
  • Loading branch information
matteodelabre committed Sep 4, 2016
1 parent 945c4e6 commit 309dea5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/prototype/parse.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,19 @@ test('should parse text nodes', assert => {
);
});

test('should parse text nodes outside of the root element', assert => {
expectEvents(assert,
'before<root>inside</root>after',
[
['text', {contents: 'before'}],
['tagopen', {name: 'root', attrs: '', isSelfClosing: false}],
['text', {contents: 'inside'}],
['tagclose', {name: 'root'}],
['text', {contents: 'after'}]
]
);
});

test('should parse a complete document', assert => {
expectEvents(assert,
tags.stripIndent`
Expand Down

0 comments on commit 309dea5

Please sign in to comment.