Avoid using toBeTruthy() and toBeFalsy() matchers
Test assertions should be explicit. If I’m trying to assert that something should be true I avoid using the toBeTruthy() matcher. It’s important to realize that in JavaScript, all values are truthy unless they are defined as falsy. This means that as long as result is not a falsy value (e.g. false, "", null, undefined, NaN, etc.), the assertion will pass. expect(result).toBeTruthy() // passes if result is {} or [] or 1 Contrast it with this approach where result will only pass if its value is true....