Skip to content

London | 26-ITP-Sep | Mahir Shah | Sprint 2 | 3 Implement and rewrite tests - #1686

Open
MahirShah300 wants to merge 16 commits into
CodeYourFuture:mainfrom
MahirShah300:coursework/sprint-3-implement-and-rewrite
Open

MahirShah300 wants to merge 16 commits into
CodeYourFuture:mainfrom
MahirShah300:coursework/sprint-3-implement-and-rewrite

Conversation

@MahirShah300

@MahirShah300 MahirShah300 commented Oct 12, 2026 •

Copy link
Copy Markdown

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

Task code

CYF-1059

Changelist

Implemented the functions and wrote tests using node and jest.

@MahirShah300 MahirShah300 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 12, 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 Oct 12, 2026
@github-actions

This comment has been minimized.

2 similar comments
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@MahirShah300 MahirShah300 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 12, 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 Oct 12, 2026
@MahirShah300 MahirShah300 reopened this Oct 12, 2026
@github-actions

This comment has been minimized.

@MahirShah300 MahirShah300 changed the title London | 26-ITP-Sep | Mahir Shah | Sprint 2 | 3-implement-and-rewrite London | 26-ITP-Sep | Mahir Shah | Sprint 2 | 3 Implement and rewrite tests Oct 12, 2026
@github-actions

This comment has been minimized.

2 similar comments
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@MahirShah300 MahirShah300 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 12, 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 Oct 17, 2026

@hey-hammad hey-hammad left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good implementation overall, couple of minor issues needs attention. Thanks


if (!validSuits.includes(suit)) {
throw new Error(
`Invalid input. Expected a number followed by a suit, but got "${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.

The error is a bit misleading, its not always a number followed by a suit, please review the conditions again from the top of the file.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I have changed the error message

test(`Should get Invalid when given "2♦ " card with trailing whitespace`, () => {
expect(() => getCardValue("2♦ ")).toThrow(/Invalid/);
});
test(`Should get Invalid when given "2♦ " card with trailing whitespace`, () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

duplicate test case.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I have removed the duplicate test

@hey-hammad hey-hammad added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Oct 17, 2026
@MahirShah300 MahirShah300 added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants