Skip to content

West Midlands | 26-Jan-ITP | Fida H Ali Zada | Sprint 3 | Implement and Rewrite Tests#1129

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

West Midlands | 26-Jan-ITP | Fida H Ali Zada | Sprint 3 | Implement and Rewrite Tests#1129
alizada-dev wants to merge 11 commits intoCodeYourFuture:mainfrom
alizada-dev:coursework/sprint-3-implement-and-rewrite

Conversation

@alizada-dev
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

Completed the Sprint 3 Implement and Rewrite Tests. I hope to see comments on my work so I can improve. Thank you.

@alizada-dev alizada-dev added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 2, 2026
// if (numerator < denominator) {
// return true
// }
return numerator < denominator;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you lookup if -1/-2, 1/-2, -1/2, 1/0, -1/0 are considered proper fraction, and then update your code and tests accordingly?

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, sir, for pointing this out. In the proper fraction, the absolute value of the numerator should be less than the denominator, and the denominator shouldn't be zero.

return Number(rankPart);
}
} else {
throw new Error("Error");
Copy link
Contributor

Choose a reason for hiding this comment

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

How could you phrase the error message so that the person using this function can understand the cause of the error?

Comment on lines +75 to +85
function assertThrows(testFunction) {
let threw = false;

try {
testFunction();
} catch (error) {
threw = true;
}

console.assert(threw, "Expected function to throw an error.")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Cleaver.

// https://jestjs.io/docs/expect#tothrowerror

// Number Cards (2-10)
test(`should return the number (numeric value)`, () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

How about ... the numeric value of number cards?

@cjyuan cjyuan 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 Mar 11, 2026
@alizada-dev alizada-dev 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 Mar 11, 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