Skip to content

Commit 7b02836

Browse files
committed
Add test for null/undefined skipping in JSX mode
1 parent fec93c5 commit 7b02836

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/jsx.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,16 @@ describe('jsx', () => {
7070
`);
7171
});
7272

73+
it('should skip null and undefined attributes', () => {
74+
expect(renderJsx(
75+
<a b={null}>bar</a>
76+
)).to.equal(`<a>bar</a>`);
77+
78+
expect(renderJsx(
79+
<a b={undefined}>bar</a>
80+
)).to.equal(`<a>bar</a>`);
81+
});
82+
7383
it('should render attributes containing VNodes', () => {
7484
expect(renderJsx(
7585
<a b={<c />}>bar</a>

0 commit comments

Comments
 (0)