Skip to content

London | 26-ITP-Jan | Divine Mankrado | Sprint 3 | Implement and Rewrite Tests#1196

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

London | 26-ITP-Jan | Divine Mankrado | Sprint 3 | Implement and Rewrite Tests#1196
divinmank wants to merge 3 commits intoCodeYourFuture:mainfrom
divinmank:coursework/sprint-3-implement-and-rewrite

Conversation

@divinmank
Copy link

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

Finished coursework on sprint 3 implement-rewrite-and-tests.

@divinmank divinmank added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 10, 2026
@favourO favourO added 🦔 Size Tiny Less than 30 minutes 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. 🦔 Size Tiny Less than 30 minutes labels Mar 14, 2026
Copy link

@favourO favourO left a comment

Choose a reason for hiding this comment

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

Nice job so far,
Please check the comments


// Example: 1/2 is a proper fraction
assertEquals(isProperFraction(1, 2), true);

Copy link

Choose a reason for hiding this comment

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

Great job, your current implementation treats every negative fraction as false, and your Jest tests are written to match that. But what is the actual rule for a “proper fraction”?

It might be worth checking whether your implementation is based on the maths definition, or whether the tests and implementation have just been made consistent with each other.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for pointing this out! I just checked the meaning of a proper fraction and realized that negative fractions can still be proper if the absolute value of the numerator is less than the absolute value of the denominator.

I’ve updated my implementation to use Math.abs() and adjusted the tests to include negative proper fractions as well.

} catch (e) { }

// Test invalid rank
try {
Copy link

Choose a reason for hiding this comment

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

It’s good that you’re thinking about invalid inputs as well as valid ones. One small improvement to think about: right now these checks only confirm that some error was thrown. Would it make the test more helpful if it also checked that the error explains the problem clearly?

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the suggestion! It makes sense. I’ve just updated the tests so they also check the error message to ensure the error clearly explains the problem with the input.

@favourO favourO 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 Mar 15, 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