West-Midlands | 26-ITP-May | Maryam Janjua | Sprint 3 | Implement and Rewrite Tests - #1603
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
2 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| if(numerator < denominator){ | ||
| return true; | ||
| } | ||
| else{ | ||
| return false; | ||
| } |
There was a problem hiding this comment.
What are the expected return value of these function calls?
isProperFraction(-1, 0)
isProperFraction(-1, -5);
isProperFraction(-1, 5);
On what authoritative source do you base your definition of a proper fraction on?
| const rank = Number(card.slice(0,-1)); | ||
| const suit = card.slice(-1); | ||
| if(rank >= 2 && rank <=10 && ["♠","♥", "♦", "♣"].includes(suit)){ | ||
| return rank; | ||
| } |
There was a problem hiding this comment.
In JavaScript, strings that represent valid numeric literals in the language can be safely converted to equivalent numbers. For examples, "0x02", "2.1", or "0002".
Does your function return the value you expected from each of the following function calls?
getCardValue("0x02♠");
getCardValue("2.1♠");
getCardValue("0002♠");
| expect(getAngleType(181)).toEqual("Reflex angle"); | ||
| }); | ||
| // Case 6: Invalid angles | ||
| test("should return 'Invalid angle' for invalid angles", () => { |
There was a problem hiding this comment.
It may not be clear what values are consider "invalid angles".
Can you revise the test description to make it more informative?
There was a problem hiding this comment.
Based on the test descriptions, it is unclear what value these function calls should return:
// It fits three of the test descriptions and they are giving contradicting info
isProperFraction(0, 0);
// No info about negative numbers
isProperFraction(-1, 2);
isProperFraction(1, -2);
isProperFraction(-1, -2);
isProperFraction(-2, 1);
isProperFraction(2, -1);
isProperFraction(-2, -1);
Learners, PR Template
Self checklist
Changelist
I have implement all the tasks according to the requirements, and test all the changes made.