Skip to content

London | 26-ITP-May | Jorvan White | Sprint 3 | Implement and Rewrite Tests - #1601

Open
JorvanW wants to merge 30 commits into
CodeYourFuture:mainfrom
JorvanW:Sprint-3/1-implement-and-rewrite-tests
Open

London | 26-ITP-May | Jorvan White | Sprint 3 | Implement and Rewrite Tests#1601
JorvanW wants to merge 30 commits into
CodeYourFuture:mainfrom
JorvanW:Sprint-3/1-implement-and-rewrite-tests

Conversation

@JorvanW

@JorvanW JorvanW commented Aug 3, 2026

Copy link
Copy Markdown

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

Created Pull Request from Sprint 3 Task and updated for Pull Request

@JorvanW JorvanW added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 3, 2026
@hackertainment hackertainment 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 Aug 7, 2026
if (denominator === 0) {
return false;
}
if (numerator < denominator && numerator > 0) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This if condition seems not quite right. Why (-2)/(-3) would return false?

});

// Case 6: Invalid angles
test(`should return "Invalid angle" when (angle < 0 || angle > 360)`, () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Besides -1 and 361, it should include the two boundary cases as well.

});

test(`should return false when both numerator and denominator are negative`, () => {
expect(isProperFraction(-1, -2)).toEqual(false);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

this one should expect true

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

there should be more negative number test cases. Can you think of them?

Comment on lines +26 to +34
// Invalid Cards
// test(`Cards without suits return as Invalid card`, () => {
// expect(getCardValue("10")).toEqual(new Error);
// });
test('Cards without suits return as Invalid card', () => {
expect(() => {
getCardValue("10");
}).toThrow("Invalid card");
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

there should be more invalid cases, Can you think of them?

@hackertainment hackertainment left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your functions are well written with clear logic and easy to read. Just need to improve on thinking test cases covering all possible scenarios. Good work, and keep it up :-)

@hackertainment hackertainment 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 Aug 7, 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