Skip to content

Birmingham | 26-ITP-May | Ogbemi Mene | Sprint 3 | Coursework with jest#1482

Open
meneogbemi42-bit wants to merge 9 commits into
CodeYourFuture:mainfrom
meneogbemi42-bit:coursework/sprint3-r
Open

Birmingham | 26-ITP-May | Ogbemi Mene | Sprint 3 | Coursework with jest#1482
meneogbemi42-bit wants to merge 9 commits into
CodeYourFuture:mainfrom
meneogbemi42-bit:coursework/sprint3-r

Conversation

@meneogbemi42-bit

@meneogbemi42-bit meneogbemi42-bit commented Jul 7, 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

Changelist

This PR implements the Sprint-3 exercise solutions and adds rewritten Jest tests — it implements three functions (getAngleType, isProperFraction, getCardValue), adds input validation/edge-case handling, and adds comprehensive Jest test suites for each.

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

This comment has been minimized.

@meneogbemi42-bit meneogbemi42-bit added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 7, 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 7, 2026
@meneogbemi42-bit meneogbemi42-bit changed the title Birmingham | 26-ITP-May | Ogbemi Mene | Coursework with jest Birmingham | 26-ITP-May | Ogbemi Mene | Sprint 3 | Coursework with jest Jul 7, 2026
@github-actions

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

@meneogbemi42-bit meneogbemi42-bit added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 8, 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 8, 2026
@meneogbemi42-bit meneogbemi42-bit added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 🏕 Priority Mandatory This work is expected labels Jul 8, 2026

@LonMcGregor LonMcGregor 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 start on this task, lots of good varied test cases. I've got a couple of comments about your implementations

function isProperFraction(numerator, denominator) {
// TODO: Implement this function
// A denominator of 0 is mathematically undefined, so it cannot be a proper fraction.
if (denominator === 0) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could you combine this condition with the returned expression below?

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.

ok, that escape me iniatially. thanks for the observation

// TODO: Implement this function
// Parse numeric ranks ("2" through "10")
const numericValue = parseInt(rank, 10);
if (!isNaN(numericValue) && numericValue >= 2 && numericValue <= 10 && String(numericValue) === rank) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What does String(numericValue) === rank do here?

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.

String(numericValue) === rank acts as a crucial validation guard. It checks if the original rank string was perfectly converted into a number, with no extra characters, decimal points, or weird spacing hanging around.

@LonMcGregor LonMcGregor added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Jul 13, 2026
@meneogbemi42-bit meneogbemi42-bit 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 Jul 14, 2026
@LonMcGregor

Copy link
Copy Markdown

Good explanation about the guard - I think it might be a bit unnecessary though, as you are converting to an integer immediately before you convert back to a string, so if there was a problem, it would show up there. However, it is good that you are considering these edge cases.

Great job simplifying the return value in the fractions task. Now that your return has a zero check, do you still need the if earlier in the code?

@LonMcGregor LonMcGregor added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Jul 15, 2026
@meneogbemi42-bit

Copy link
Copy Markdown
Author

please i just wanted to be sure of the code you are talking about so i chould correct it.

@meneogbemi42-bit meneogbemi42-bit 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 Jul 15, 2026
@LonMcGregor

Copy link
Copy Markdown

I think here you could probably remove the guard. You can also change your fractions function - now you have your zero checked in the return, do you still need the if part above it?

@LonMcGregor LonMcGregor added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Jul 15, 2026
Removed redundant check for string equality in numeric rank validation.
@meneogbemi42-bit

Copy link
Copy Markdown
Author

if i remove {if (rank === "A") return 11;} passing an Ace (like "A♠") will now be treated as an invalid rank and will throw an error. and If you remove the line if (["J", "Q", "K"].includes(rank)) return 10;, face cards (Jacks, Queens, and Kings) will no longer be recognized as valid and will throw an error.

@meneogbemi42-bit meneogbemi42-bit 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 Jul 15, 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. 🏕 Priority Mandatory This work is expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants