West Midlands | 26-Jan-ITP | Fida H Ali Zada | Sprint 3 | Implement and Rewrite Tests#1129
Open
alizada-dev wants to merge 11 commits intoCodeYourFuture:mainfrom
Open
Conversation
cjyuan
reviewed
Mar 11, 2026
| // if (numerator < denominator) { | ||
| // return true | ||
| // } | ||
| return numerator < denominator; |
Contributor
There was a problem hiding this comment.
Can you lookup if -1/-2, 1/-2, -1/2, 1/0, -1/0 are considered proper fraction, and then update your code and tests accordingly?
Author
There was a problem hiding this comment.
Thank you, sir, for pointing this out. In the proper fraction, the absolute value of the numerator should be less than the denominator, and the denominator shouldn't be zero.
| return Number(rankPart); | ||
| } | ||
| } else { | ||
| throw new Error("Error"); |
Contributor
There was a problem hiding this comment.
How could you phrase the error message so that the person using this function can understand the cause of the error?
Comment on lines
+75
to
+85
| function assertThrows(testFunction) { | ||
| let threw = false; | ||
|
|
||
| try { | ||
| testFunction(); | ||
| } catch (error) { | ||
| threw = true; | ||
| } | ||
|
|
||
| console.assert(threw, "Expected function to throw an error.") | ||
| } |
| // https://jestjs.io/docs/expect#tothrowerror | ||
|
|
||
| // Number Cards (2-10) | ||
| test(`should return the number (numeric value)`, () => { |
Contributor
There was a problem hiding this comment.
How about ... the numeric value of number cards?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Learners, PR Template
Self checklist
Changelist
Completed the Sprint 3 Implement and Rewrite Tests. I hope to see comments on my work so I can improve. Thank you.