Make Your Test Fail

Kent C. Dodds
InstructorKent C. Dodds

Share this video with your friends

Send Tweet
Published 3 years ago
Updated 2 years ago

If you're not careful you can write a test that's worse than having not tests at all. In this lesson we'll learn why that is and how you can avoid it by making sure your test can fail.

This is based on my blog post: Make Your Test Fail

~ 3 years ago

what about testing each rule separately. eg

hasDigits :  (string) => boolean

write the positive and negative cases for each rule.

then compose rules in isPasswordAllowed, at last, add some accept cases for isPasswordAllowed

~ 3 years ago

so every rule is tested directly, not by adjusting input in cases.