Skip to content

London | 26-ITP-May | Russom Gebremeskel | Sprint 3 | 1 Implement and Rewrite Tests#1529

Open
russom-g wants to merge 12 commits into
CodeYourFuture:mainfrom
russom-g:Sprint-3/1-implement-and-rewrite-tests
Open

London | 26-ITP-May | Russom Gebremeskel | Sprint 3 | 1 Implement and Rewrite Tests#1529
russom-g wants to merge 12 commits into
CodeYourFuture:mainfrom
russom-g:Sprint-3/1-implement-and-rewrite-tests

Conversation

@russom-g

@russom-g russom-g commented Jul 19, 2026

Copy link
Copy Markdown

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

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.

@github-actions

This comment has been minimized.

@russom-g russom-g added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 19, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 19, 2026
@github-actions

This comment has been minimized.

@russom-g russom-g added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 19, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 19, 2026
File deleted as PR wasn't accepting it.
@russom-g russom-g added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 19, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 19, 2026
@russom-g russom-g changed the title London | 26-ITP-May | Russom Gebremeskel | Sprint 3 | Implement and Rewrite Tests London | 26-ITP-May | Russom Gebremeskel | Sprint 3 | 1 Implement and Rewrite Tests Jul 19, 2026
@github-actions

This comment has been minimized.

@russom-g russom-g added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 20, 2026
@hey-hammad hey-hammad added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Jul 25, 2026

function getCardValue(card) {
// TODO: Implement this function
if (card <= 1 && card >= 10 || typeof card !== "string") {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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`, () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please review the test cases and make sure they are passing.

@hey-hammad hey-hammad removed the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Jul 25, 2026
@hey-hammad hey-hammad added the Reviewed Volunteer to add when completing a review with trainee action still to take. label Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants