Repository navigation
Conversation
|
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. |
1 similar comment
|
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. |
hackertainment
left a comment
There was a problem hiding this comment.
The code looks quite clean to me, and please keep it up. Just need a few test cases for negative proper fraction and an explanation to one of my comments. Also, please remove files that do not belong to this exercise (ref: #1770 (comment) ). Thank you.
| test("Handles negative numerators", () => { | ||
| assert.equal(isProperFraction(-1, 2), true); | ||
| assert.equal(isProperFraction(-5, 2), false); | ||
| }); | ||
|
|
||
| test("Handles negative denominators", () => { | ||
| assert.equal(isProperFraction(1, -2), true); | ||
| assert.equal(isProperFraction(3, -2), false); | ||
| }); |
There was a problem hiding this comment.
How about both numerator and denominator are negative (e.g. -1/-2 and -2/-1)?
| test("Handles negative numerators", () => { | ||
| expect(isProperFraction(-1, 2)).toEqual(true); | ||
| expect(isProperFraction(-5, 2)).toEqual(false); | ||
| }); | ||
|
|
||
| test("Handles negative denominators", () => { | ||
| expect(isProperFraction(1, -2)).toEqual(true); | ||
| expect(isProperFraction(3, -2)).toEqual(false); | ||
| }); |
There was a problem hiding this comment.
How about both numerator and denominator are negative (e.g. -1/-2 and -2/-1)?
|
|
||
| export function getCardValue(card) { | ||
| // TODO: Implement this function | ||
| const validCard = /^(A|[2-9]|10|J|Q|K)[♠♥♦♣]$/; |
There was a problem hiding this comment.
This line and your program is correct. For me to understand your thinking process, can you please explain the breakdown of the expression you used (and any possible chance to simplify it)? Also, what are the advantages of using such expression over other implementations? No code change is required and just adding a reply to this comment would be good enough. Thank you.
|
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. |
1 similar comment
|
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. |
Learners, PR Template
Self checklist
Task code
CYF-1059
Changelist
Implemented
getAngleType,isProperFraction, andgetCardValue. Added comprehensive tests using Node's built-in test runner and rewrote the tests using Jest, covering normal cases, boundary cases, and invalid inputs. All tests pass.