Skip to content

West Midlands | 25-ITP-May | Mustaf Asani | Module-Structuring-and -Testing-Data | Sprint 3 #679

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

asaniDev
Copy link

Learners, PR Template

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

sprint 3 tasks completed

Questions

Ask any questions you have for your reviewer.

@asaniDev asaniDev added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 22, 2025
@LonMcGregor LonMcGregor 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 22, 2025
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.

Good start on this sprint. There are a few tasks you should review as there are some logic issues in your code. Also make sure not to commit package files by accident

@@ -9,6 +9,11 @@

function isProperFraction(numerator, denominator) {
if (numerator < denominator) return true;

Choose a reason for hiding this comment

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

What happens if I give it a negative improper fraction, like -20/2?

return 11;
} else if (rank === "K" || rank === "Q" || rank === "J" || rank === "10") {
return 10;
}else if (rank >= "2" && rank <= "9") {

Choose a reason for hiding this comment

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

If I give it a strange value like "222♥" what would you expect the output to be? What actually happens?

@@ -1,6 +1,12 @@
function isProperFraction(numerator, denominator) {
if (numerator < denominator) return true;
if (Math.abs(numerator) < Math.abs(denominator)) return true;

Choose a reason for hiding this comment

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

This is a more correct solution - you may want to use it in your earlier task

Choose a reason for hiding this comment

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

Don't commit package files unless you are making a deliberate necessary change to the node setup - can you remove it from here, and the other places it is present in this commit?

return "3rd";
case 4:
return "4th";
case 5:

Choose a reason for hiding this comment

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

There is a lot of duplication here - can you think of a way to make this code a bit cleaner?

(Hint: You did a better job in the next part of the if branch)

}
} else if(num > 10 && num < 21) {
return num + "th";
} else if (num > 20) {

Choose a reason for hiding this comment

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

What about 111? We would usually state that as "111th".

// Case 10: Identify the ordinal number for 10
test("should return '10th' for 10", () => {
expect(getOrdinalNumber(10)).toEqual("10th");
});

Choose a reason for hiding this comment

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

You should consider testing all your branches - what about the larger numbers?

@LonMcGregor LonMcGregor 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 Jul 22, 2025
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