Skip to content

London | 26-ITP-Jan | Oussama Mouggal | sprint 3 | implement-and-rewrite-tests#1026

Open
Oussama-Mouggal wants to merge 9 commits intoCodeYourFuture:mainfrom
Oussama-Mouggal:coursework/sprint-3-implement-and-rewrite
Open

London | 26-ITP-Jan | Oussama Mouggal | sprint 3 | implement-and-rewrite-tests#1026
Oussama-Mouggal wants to merge 9 commits intoCodeYourFuture:mainfrom
Oussama-Mouggal:coursework/sprint-3-implement-and-rewrite

Conversation

@Oussama-Mouggal
Copy link

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

I rewrited the code and tested edge cases using jest

@Oussama-Mouggal Oussama-Mouggal added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 23, 2026
@Oussama-Mouggal Oussama-Mouggal changed the title London | 26-ITP-Jan | Oussama Mouggal | sprint 3 | implement-and-rewrite London | 26-ITP-Jan | Oussama Mouggal | sprint 3 | implement-and-rewrite-tests Feb 23, 2026
@LonMcGregor LonMcGregor added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Mar 3, 2026
Copy link

@LonMcGregor LonMcGregor left a comment

Choose a reason for hiding this comment

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

Very good work adding lots of test cases - especially catching edge cases.

You may want to take a closer look at some of the implementation which could be improved

console.error("Error was not thrown for extra characters");
} catch (e) {}

console.log("All tests completed!");

Choose a reason for hiding this comment

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

This code is imported as a module for another test. Be careful about putting extra console.logs here.

Copy link
Author

Choose a reason for hiding this comment

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

I made the required changes to run the code only when the file is executed directly.Thanks


function isProperFraction(numerator, denominator) {
// TODO: Implement this function
return numerator > 0 && denominator > 0 && numerator < denominator;

Choose a reason for hiding this comment

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

0 / 5 is a valid proper fraction. Can you take another look at the tests and implementation for this?

Copy link
Author

Choose a reason for hiding this comment

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

Thank you for your feedback, I updated isProperFraction to fit all required test cases.

const rank = card.slice(0, -1);

// Validate suit
if (!validSuits.includes(suit)) {

Choose a reason for hiding this comment

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

You have two if branches that end up doing the same thing. Is there a way they could be combined?

Copy link
Author

Choose a reason for hiding this comment

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

Thank you @LonMcGregor for your valuable feedback. I combined the two branches with || condition for a cleaner 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. Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Mar 3, 2026
@Oussama-Mouggal Oussama-Mouggal added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 3, 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. 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