Skip to content

London|ITP-Jan-2026|Ping Wang|Sprint 3|1-implement-and -rewrite -tests#1103

Open
pathywang wants to merge 10 commits intoCodeYourFuture:mainfrom
pathywang:Sprint-3/1-implement-rewrite-tests
Open

London|ITP-Jan-2026|Ping Wang|Sprint 3|1-implement-and -rewrite -tests#1103
pathywang wants to merge 10 commits intoCodeYourFuture:mainfrom
pathywang:Sprint-3/1-implement-rewrite-tests

Conversation

@pathywang
Copy link

  • 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 did prep the do this coursework with node and npm test to check everything is ok

@github-actions

This comment has been minimized.

@pathywang pathywang changed the title London|ITP-Jan-2026|Ping Wang|Sprint3|1-implement-and -rewrite -tests London|ITP-Jan-2026|Ping Wang|Sprint 3|1-implement-and -rewrite -tests Feb 28, 2026
@pathywang pathywang added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 28, 2026
Copy link

@Lindronics Lindronics left a comment

Choose a reason for hiding this comment

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

Overall looks great! I would add a few more assertions here and there to test for edge cases!

const right = getAngleType(90);
assertEquals(right, "Right angle");

// Case 2: Identify Acute Angles:

Choose a reason for hiding this comment

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

Can you think of a couple more edge cases that could happen here? Try to think of boundaries and possible invalid values.

assertEquals(isProperFraction(5,5), false);

//Case 3: (-3)/(-5) is a proper fraction
assertEquals(isFinite(-3,-5), true);

Choose a reason for hiding this comment

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

Are we testing for the right thing here?

Comment on lines +32 to +39
if (!validSuits.includes(suit) || !validRanks.includes(rank)) {
throw new Error("Invalid card");
}

if (rank === "A") return 11;
if (["J", "Q", "K"].includes(rank)) return 10;

return Number(rank);

Choose a reason for hiding this comment

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

Nice, I really like the use of the "guard pattern" here to deal with errors first 👍🏻.

// Handling invalid cards
try {
getCardValue("invalid");
//Examples J Q K:,

Choose a reason for hiding this comment

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

Seems like we might be missing a case here?

})

// Case 6: Invalid angles
test('should return "Invalid angle"when (angle>=360)', ()=> {

Choose a reason for hiding this comment

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

Again, let's focus on other edge cases and boundaries that could occur here!

});

//case:absolute numerator is bigger than absolute denominator
test ('should return false when numerator absolute is bigger than denominator absolute',() => {

Choose a reason for hiding this comment

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

Are these all possible combinations? Keep in mind that you can group similar tests together with Jest.

@Lindronics Lindronics 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 7, 2026
@pathywang pathywang 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 7, 2026
@Lindronics Lindronics added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Mar 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants