London|ITP-Jan-2026|Ping Wang|Sprint 3|1-implement-and -rewrite -tests#1103
London|ITP-Jan-2026|Ping Wang|Sprint 3|1-implement-and -rewrite -tests#1103pathywang wants to merge 10 commits intoCodeYourFuture:mainfrom
Conversation
This comment has been minimized.
This comment has been minimized.
Lindronics
left a comment
There was a problem hiding this comment.
Overall looks great! I would add a few more assertions here and there to test for edge cases!
| const right = getAngleType(90); | ||
| assertEquals(right, "Right angle"); | ||
|
|
||
| // Case 2: Identify Acute Angles: |
There was a problem hiding this comment.
Can you think of a couple more edge cases that could happen here? Try to think of boundaries and possible invalid values.
| assertEquals(isProperFraction(5,5), false); | ||
|
|
||
| //Case 3: (-3)/(-5) is a proper fraction | ||
| assertEquals(isFinite(-3,-5), true); |
There was a problem hiding this comment.
Are we testing for the right thing here?
| if (!validSuits.includes(suit) || !validRanks.includes(rank)) { | ||
| throw new Error("Invalid card"); | ||
| } | ||
|
|
||
| if (rank === "A") return 11; | ||
| if (["J", "Q", "K"].includes(rank)) return 10; | ||
|
|
||
| return Number(rank); |
There was a problem hiding this comment.
Nice, I really like the use of the "guard pattern" here to deal with errors first 👍🏻.
| // Handling invalid cards | ||
| try { | ||
| getCardValue("invalid"); | ||
| //Examples J Q K:, |
There was a problem hiding this comment.
Seems like we might be missing a case here?
| }) | ||
|
|
||
| // Case 6: Invalid angles | ||
| test('should return "Invalid angle"when (angle>=360)', ()=> { |
There was a problem hiding this comment.
Again, let's focus on other edge cases and boundaries that could occur here!
| }); | ||
|
|
||
| //case:absolute numerator is bigger than absolute denominator | ||
| test ('should return false when numerator absolute is bigger than denominator absolute',() => { |
There was a problem hiding this comment.
Are these all possible combinations? Keep in mind that you can group similar tests together with Jest.
Changelist
i did prep the do this coursework with node and npm test to check everything is ok