Skip to content

Commit

Permalink
Fixes choojs/nanohtml#51. 'false' doesn't render
Browse files Browse the repository at this point in the history
  • Loading branch information
mjstahl committed Jun 21, 2019
1 parent c397ca9 commit 85287a3
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion test/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,15 @@ test('null value (empty)', function (t) {
t.end()
})

test('string value (empty)', function (t) {
var tree = hx`<div>${''}</div>`
t.equal(vdom.create(tree).toString(), '<div></div>')
t.end()
})

test('boolean value', function (t) {
var tree = hx`<div>${false}</div>`
t.equal(vdom.create(tree).toString(), '<div>false</div>')
t.equal(vdom.create(tree).toString(), '<div></div>')
t.end()
})

Expand All @@ -26,3 +32,9 @@ test('numeric value', function (t) {
t.equal(vdom.create(tree).toString(), '<div>555</div>')
t.end()
})

test('numeric value (zero)', function (t) {
var tree = hx`<div>${0}</div>`
t.equal(vdom.create(tree).toString(), '<div>0</div>')
t.end()
})

0 comments on commit 85287a3

Please sign in to comment.