Skip to content

Commit 85287a3

Browse files
committed
Fixes choojs/nanohtml#51. 'false' doesn't render
1 parent c397ca9 commit 85287a3

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

test/types.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,15 @@ test('null value (empty)', function (t) {
1515
t.end()
1616
})
1717

18+
test('string value (empty)', function (t) {
19+
var tree = hx`<div>${''}</div>`
20+
t.equal(vdom.create(tree).toString(), '<div></div>')
21+
t.end()
22+
})
23+
1824
test('boolean value', function (t) {
1925
var tree = hx`<div>${false}</div>`
20-
t.equal(vdom.create(tree).toString(), '<div>false</div>')
26+
t.equal(vdom.create(tree).toString(), '<div></div>')
2127
t.end()
2228
})
2329

@@ -26,3 +32,9 @@ test('numeric value', function (t) {
2632
t.equal(vdom.create(tree).toString(), '<div>555</div>')
2733
t.end()
2834
})
35+
36+
test('numeric value (zero)', function (t) {
37+
var tree = hx`<div>${0}</div>`
38+
t.equal(vdom.create(tree).toString(), '<div>0</div>')
39+
t.end()
40+
})

0 commit comments

Comments
 (0)