Manchester | 26-ITP-May |Abdu Hassen | Sprint 3 |implement and rewrite tests#1486
Manchester | 26-ITP-May |Abdu Hassen | Sprint 3 |implement and rewrite tests#1486Abduhasen wants to merge 2 commits into
Conversation
This comment has been minimized.
This comment has been minimized.
3167d4f to
9091cac
Compare
| } else if (denominator === 0) { | ||
| return false; | ||
| } else { | ||
| return false; | ||
| } |
There was a problem hiding this comment.
Code on lines 16-20 could further be simplified.
|
|
||
| function getCardValue(card) { | ||
| // TODO: Implement this function | ||
| const validRank = [ |
There was a problem hiding this comment.
It's common practice to use plural names for arrays.
| return "Right angle"; | ||
| } else if (90 < angle && angle < 180) { | ||
| return "Obtuse angles"; |
There was a problem hiding this comment.
Should some in singular form and some in plural form?
| expect(getAngleType(-2)).toEqual("Invalid angles"); | ||
| expect(getAngleType(361)).toEqual("Invalid angles"); | ||
| expect(getAngleType(890)).toEqual("Invalid angles"); | ||
| }); |
There was a problem hiding this comment.
-
Could consider explicitly specify the range of the invalid angles in the test description.
-
Why not test the boundary cases?
| test(`should return false when the denominator less nominator`, () => { | ||
| expect(isProperFraction(7, 2)).toEqual(false); | ||
| expect(isProperFraction(-17, -2)).toEqual(false); | ||
| expect(isProperFraction(0.5, 0.1)).toEqual(false); | ||
| }); | ||
| test(`should return true when denominator is greater than nominator`, () => { | ||
| expect(isProperFraction(2, 8)).toEqual(true); |
There was a problem hiding this comment.
-
The test description applies only when the values being compared are the absolute values of the denominator and numerator. You could consider using pseudo-code and notations like
abs(...)or| ... |to denote absolute value in the test description. -
Why not test the boundary cases?
Note: The correct term is numerator (not nominator).
Learners, PR Template
Self checklist
Changelist
This PR implements the required function and updates the related tests to match the new implementation.
Questions
N/A