London | 26-ITP-May | Jorvan White | Sprint 3 | Implement and Rewrite Tests - #1601
Open
JorvanW wants to merge 30 commits into
Open
London | 26-ITP-May | Jorvan White | Sprint 3 | Implement and Rewrite Tests#1601JorvanW wants to merge 30 commits into
JorvanW wants to merge 30 commits into
Conversation
| if (denominator === 0) { | ||
| return false; | ||
| } | ||
| if (numerator < denominator && numerator > 0) { |
There was a problem hiding this comment.
This if condition seems not quite right. Why (-2)/(-3) would return false?
| }); | ||
|
|
||
| // Case 6: Invalid angles | ||
| test(`should return "Invalid angle" when (angle < 0 || angle > 360)`, () => { |
There was a problem hiding this comment.
Besides -1 and 361, it should include the two boundary cases as well.
| }); | ||
|
|
||
| test(`should return false when both numerator and denominator are negative`, () => { | ||
| expect(isProperFraction(-1, -2)).toEqual(false); |
There was a problem hiding this comment.
there should be more negative number test cases. Can you think of them?
Comment on lines
+26
to
+34
| // Invalid Cards | ||
| // test(`Cards without suits return as Invalid card`, () => { | ||
| // expect(getCardValue("10")).toEqual(new Error); | ||
| // }); | ||
| test('Cards without suits return as Invalid card', () => { | ||
| expect(() => { | ||
| getCardValue("10"); | ||
| }).toThrow("Invalid card"); | ||
| }); |
There was a problem hiding this comment.
there should be more invalid cases, Can you think of them?
hackertainment
left a comment
There was a problem hiding this comment.
Your functions are well written with clear logic and easy to read. Just need to improve on thinking test cases covering all possible scenarios. Good work, and keep it up :-)
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.
Self checklist
Changelist
Created Pull Request from Sprint 3 Task and updated for Pull Request