Birmingham | 26-ITP-May | Tobias Amaechina | Sprint 3 | implement and rewrite-test with jest#1476
Conversation
…intor is positive
…nator is positive
…nator is negative
…are -ve, however the numerator is less than denominator in absolute terms
LonMcGregor
left a comment
There was a problem hiding this comment.
Good work and good test cases. this task looks complete!
|
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. |
Self checklist
Changelist
1 Full Implementation of getCardValue
Added complete logic for parsing card strings.
Validates both rank and suit according to the rules of a standard 52‑card deck.
Returns correct numerical values:
Ace → 11
Face cards → 10
Number cards → their numeric value
Throws descriptive errors for invalid input.
Rewritten and Expanded Test Suite
Replaced legacy assertions with clearer, structured tests.
Added coverage for:
All valid card types
All face cards
Ace handling
Numeric cards
Error cases (invalid rank, invalid suit, missing suit, missing rank, non‑string input, malformed card formats)
Ensures the function behaves correctly across edge cases.