Skip to content

Commit 3493d4f

Browse files
committed
test: if tree exists empty string, issue #58
1 parent e7f8d33 commit 3493d4f

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

test/test-core.spec.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,48 @@ test('{Tree} {Immutable}', t => {
237237
t.is(html1, html2);
238238
});
239239

240+
test('{Tree} {With empty string}', t => {
241+
const tree = [
242+
'',
243+
'<!doctype html>',
244+
'',
245+
{
246+
tag: 'html',
247+
attrs: {
248+
lang: 'en'
249+
},
250+
content: [
251+
'',
252+
{
253+
tag: 'head',
254+
content: [
255+
'',
256+
{
257+
tag: 'meta',
258+
attrs: {
259+
charset: 'utf-8'
260+
}
261+
},
262+
''
263+
]
264+
},
265+
'',
266+
{
267+
tag: 'body',
268+
content: [
269+
' '
270+
]
271+
},
272+
''
273+
]
274+
},
275+
''
276+
];
277+
const html = '<!doctype html><html lang="en"><head><meta charset="utf-8"></head><body> </body></html>';
278+
279+
t.is(render(tree), html);
280+
});
281+
240282
test('{Options} {singleTag} Defaults', t => {
241283
const SINGLE_TAGS_LOWERCASE = [
242284
'area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'menuitem', 'meta', 'param', 'source', 'track', 'wbr'

0 commit comments

Comments
 (0)