-
-
Notifications
You must be signed in to change notification settings - Fork 195
Sheffield| May 2025| Mayowa Fadare| Structure testing sprint 3 #633
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Sheffield| May 2025| Mayowa Fadare| Structure testing sprint 3 #633
Conversation
if (!isNaN(number) && number >= 2 && number <= 9) { | ||
return number; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does your function return the value you expected from each of the following function calls?
getCardValue("2A♠");
getCardValue("5.1♠");
getCardValue("0x02♠");
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you checked if the above function calls can return the expected value?
Sprint-3/3-mandatory-practice/implement/get-ordinal-number.test.js
Outdated
Show resolved
Hide resolved
test("Password must be at least 5 characters long.", () => { | ||
expect(passwordValidator("Strong1!")).toBe(true); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should also test if the function can return false when a password contains less than 5 characters.
test("Password must include at least one uppercase letter.", () =>{ | ||
expect(passwordValidator("strong1")).toBe(false); | ||
} ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function can return false
for multiple reasons.
To test a specific reason, choose an input that satisfies all other conditions except the one you're targeting. This way, if the function returns false
, you can confidently attribute it to that specific condition.
For example, the function might return false
for "strong1" because
- it lacks an uppercase letter, OR
- it lacks a non-alphanumeric character
As a result, when the function return false, we cannot be certain exactly why it returns false.
Learners, PR Template
Self checklist
Changelist
Made changes on the sprint 3 unit of the module structuring and testing, using the template provided
Questions
Ask any questions you have for your reviewer.