London | 26-ITP-May | Russom Gebremeskel | Sprint 3 | 1 Implement and Rewrite Tests#1529
Open
russom-g wants to merge 12 commits into
Open
London | 26-ITP-May | Russom Gebremeskel | Sprint 3 | 1 Implement and Rewrite Tests#1529russom-g wants to merge 12 commits into
russom-g wants to merge 12 commits into
Conversation
added 9 commits
July 4, 2026 21:48
…f card rank and suits.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
File deleted as PR wasn't accepting it.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
hey-hammad
suggested changes
Jul 25, 2026
|
|
||
| function getCardValue(card) { | ||
| // TODO: Implement this function | ||
| if (card <= 1 && card >= 10 || typeof card !== "string") { |
There was a problem hiding this comment.
please review the condition card <= 1 && card >= 10.
| const rank = card.slice(0, -1); | ||
|
|
||
| if (!validRanks.includes(rank) || !validSuits.includes(suit)) { //Here the values that are stored in rank and suit are checked whether they are valid are inside the validRank and validSuits arrays. | ||
| return card + " Invalid card"; |
There was a problem hiding this comment.
Its better to throw an error here rather than returning the card + invalid string as an output of the function.
| }); | ||
|
|
||
| // Case 4: Invalid Cards | ||
| test(`Should return invalid cards when given a face card`, () => { |
There was a problem hiding this comment.
please review the test cases and make sure they are passing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Learners, PR Template
Self checklist
Changelist
Multiple test cases written with Jest including special and edge cases prior to writing functions. Afterwards multiple functions implemented to cover for those tests. Some of the test were fixed or rewritten after finding issues.