anthonyshort / deku

Render interfaces using pure functions and virtual DOM
https://github.com/anthonyshort/deku/tree/master/docs
3.41k stars 130 forks source link

Add null rendering test #369

Closed rstacruz closed 8 years ago

rstacruz commented 8 years ago

Here's a failing test case.

rstacruz commented 8 years ago

okaayyy.. i could've sworn that failed on my machine...

rstacruz commented 8 years ago

okay, I see now: it seems CI will always pass, even if tests fail (!). Have a look at the CI logs and you should see the failure.

rstacruz commented 8 years ago

Relevant: https://github.com/juliangruber/tape-run/issues/27

anthonyshort commented 8 years ago

I'm not entirely sure if it's worth adding this feature when a user could just as easily add a <noscript /> or <div /> instead. What do you think?

rstacruz commented 8 years ago

If undefined is handled, then I'd expect null to be too. This is a very common pattern after all:

return <div>
  { someCondition && <Navigation /> }
  { someCondition && <Content /> }
</div>
/* if someCondition is `null`, then we're screwed */
anthonyshort commented 8 years ago

These tests were added in another branch last week :)