3 ms·
> This means that the instanceof operator will not work as expected, and it will generate false negatives! But this isn’t a silent failure, so it’s obviously d
by Zetice 3y ago
> This means that the instanceof operator will not work as expected, and it will generate false negatives!
But this isn’t a silent failure, so it’s obviously detectable and therefore (if you know why) avoidable. It’s also so rare that you’d need to read a blog article to even know it was possible.
So I’ll keep using jest, because my tests all pass. When I hit one that doesn’t (and I can’t figure out why) I keep this in mind, but otherwise “not recommended” is overkill.
- afro88 3y agoExcept when you test that something is *not* an instance of something else and the test wrongly passes. Then you'll be scratching your head trying to fix a bug already in production.