Skip to content

London | 26-ITP-SEPT | Carol Nassuna | Sprint 1 | Module-Data-Groups - #1489

Open
Mugs3 wants to merge 2 commits into
CodeYourFuture:mainfrom
Mugs3:Sprint-1
Open

Mugs3 wants to merge 2 commits into
CodeYourFuture:mainfrom
Mugs3:Sprint-1

Conversation

@Mugs3

@Mugs3 Mugs3 commented Nov 3, 2026 •

Copy link
Copy Markdown
  • 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

Task code

CYF-1071

Changelist

Fixed code in the respective files
29/11 - changed the mean test file to not pass argument in the no argument test case

@Mugs3 Mugs3 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Nov 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 Nov 5, 2026
@hackertainment

Copy link
Copy Markdown

Just need to fix mean.test.js and the other two comments are for your future reference only. You are almost there and please keep it up. Thank you.

@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 Nov 5, 2026
Comment on lines +31 to +37
try {
expect(describeMedian([])).toBe(
"Could not calculate a median: calculateMedian requires a non-empty array"
);
} catch (error) {
throw new Error(`Empty-array case failed: ${error.message}`);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The try-catch block here is not needed as describeMedian() has already catched the error and no longer throws more error. If you need further clarification, please discuss with a volunteer on Saturday workshop. Thank you.

Comment on lines +44 to +50
try {
expect(describeMedian(["banana", "apple", "orange"])).toBe(
"Could not calculate a median: calculateMedian requires an array of numbers"
);
} catch (error) {
throw new Error(`String-array case failed: ${error.message}`);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The try-catch block here is not needed as describeMedian() has already catched the error and no longer throws more error. If you need further clarification, please discuss with a volunteer on Saturday workshop. Thank you.

Comment on lines 61 to +68
// Given no argument at all
// When passed to calculateMean
// Then it should throw Error("calculateMean requires an array of numbers")
it("throws when the input has no argument", () => {
expect(() => calculateMean("")).toThrow(
"calculateMean requires an array of numbers"
);
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Empty string is still an argument, but this test case should be not passing in any argument. Please fix it, thank you.

@Mugs3 Mugs3 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 Nov 29, 2026
Comment thread Sprint-1/implement/describe-median.js Resolved
Comment on lines +51 to +52
it("throws when the input is not an array", () => {
expect(() => sum("Hey", 42, "")).toThrow("sum requires an array of numbers");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Which input reaches sum in this test, and does it add coverage beyond the preceding string-input test?

To "like" or "dislike" this comment, please follow this link

@cyf-ai-code-reviewer cyf-ai-code-reviewer Bot 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 Nov 29, 2026
@cyf-ai-code-reviewer

Copy link
Copy Markdown

The CYF AI review has left comments. It will only review a PR one time. When you have addressed these comments, please request review again and a volunteer will take a look.

@Mugs3 Mugs3 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 Nov 29, 2026
@hackertainment

Copy link
Copy Markdown

Congratulation, you have completed this PR successfully.

@hackertainment hackertainment 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 Dec 1, 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