Make Your Test Fail

Share this video with your friends

Send Tweet

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

HaveF
HaveF
~ 5 years ago

what about testing each rule separately. eg

hasDigits :  (string) => boolean
hasUpperCase,
longEnough,

write the positive and negative cases for each rule.

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

HaveF
HaveF
~ 5 years ago

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