Skip to content

Commit 3835bac

Browse files
committed
Add HTML comment tests
1 parent 11d1cc7 commit 3835bac

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/index.test.mjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,4 +182,11 @@ describe('htm', () => {
182182
html`<a ...${obj} b="1" />`;
183183
expect(obj).toEqual({});
184184
});
185+
186+
test('ignore HTML comments', () => {
187+
expect(html`<a><!-- Hello, world! --></a>`).toEqual(h('a', null));
188+
expect(html`<a><!-- Hello,\nworld! --></a>`).toEqual(h('a', null));
189+
expect(html`<a><!-- ${'Hello, world!'} --></a>`).toEqual(h('a', null));
190+
expect(html`<a><!--> Hello, world <!--></a>`).toEqual(h('a', null));
191+
});
185192
});

0 commit comments

Comments
 (0)