bikeshaving / crank

The Just JavaScript Framework
https://crank.js.org
MIT License
2.7k stars 75 forks source link

add warnings when components yield or return undefined #203

Closed brainkim closed 3 years ago

brainkim commented 3 years ago

Implements warnings for when components yield or return null.

This PR unearthed some deeply spooky shit where a test which contained only synchronous code started failing occasionally. It only happened in a sad path test (an infinite loop edge case), but it confused the shit out of me. You can reproduce by checkout out the failing commit (https://github.com/bikeshaving/crank/pull/203/commits/9ba44d7d0c7e1ec71becdac067a88d53b1949268). I briefly investigated this, and it was due to a stack overflow error happening randomly. My suspicion is that it’s something to do with Jest, but who knows, I may have also stumbled upon an edge case to do with generators. In either case, I’ve mitigated it by adding another flag for when components error so whatever.