Repository navigation
London | 26-ITP-Sep | Mandip Sanger | Sprint 3 | Implement-and-rewrire-tests - #1612
mandipsanger wants to merge 18 commits into
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
LonMcGregor
left a comment
There was a problem hiding this comment.
Almost there, just a couple of small comments to fix
| } | ||
|
|
||
| if ( | ||
| rank === "2" || |
There was a problem hiding this comment.
This seems pretty complex, is there a way you could simplify checking these numbers?
There was a problem hiding this comment.
That is much better, the duplicated block is gone. One thing on this same line though. Number(rank) accepts more than you might expect. Try getCardValue("2.1♠"), getCardValue("0002♠") and getCardValue("0x02♠"). What comes back, and what should come back?
Refactored card value retrieval logic to simplify rank checks.
LonMcGregor
left a comment
There was a problem hiding this comment.
You marked my comment about the fractions as resolved, but you don't seem to have addressed my comment. Did you understand it?
Also, did you run the tests before comitting and updating the PR? I get errors when I try to run it.
|
I am still getting a lot of errors when I run the test. Do you also see these when you run the test command? |
|
I have tested most of them now and will do it onces again. for rank i need to use loop and will push it soon. |
abdishakoor-dev
left a comment
There was a problem hiding this comment.
The Jest suite runs clean for me now, 19 tests passing, so that part is sorted. getAngleType is solid.
The fraction function is the main thing left.
-
isProperFraction. A fraction is proper when the numerator is smaller than the denominator ignoring the minus signs. So -4/-5 is proper, and so is 1/-5. Your function returns false for both, and your tests on lines 34 and 38 say false is correct. It is the function that needs to change here, and then those two tests. One more to think about: what shouldisProperFraction(-2, 1)be, and what does your function return for it now? -
getCardValueaccepts some cards it should reject. See my reply on theNumber(rank)line.
Add the Needs Review label again when you have pushed.
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.
|
The files changed in this PR don't match what is expected for this task. Please check that you committed the right files for the task, and that there are no accidentally committed files from other sprints. Please review the 'files changed' tab at the top of the page. Here is an example of a file that has been changed on this branch but shouldn't be: If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above. |
|
The files changed in this PR don't match what is expected for this task. Please check that you committed the right files for the task, and that there are no accidentally committed files from other sprints. Please review the 'files changed' tab at the top of the page. Here is an example of a file that has been changed on this branch but shouldn't be: If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above. |
Self checklist
Task code
CYF-1059
Changelist
Sprint 3 coursework