Skip to content

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

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

Mugs3 wants to merge 1 commit 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

@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.

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