Skip to content

Manchester | 26-ITP-Jan | Mehroz Munir | Sprint 2 | Coursework#1051

Closed
MehrozMunir wants to merge 6 commits intoCodeYourFuture:mainfrom
MehrozMunir:coursework/sprint-2
Closed

Manchester | 26-ITP-Jan | Mehroz Munir | Sprint 2 | Coursework#1051
MehrozMunir wants to merge 6 commits intoCodeYourFuture:mainfrom
MehrozMunir:coursework/sprint-2

Conversation

@MehrozMunir
Copy link
Copy Markdown

No description provided.

@MehrozMunir MehrozMunir added 📅 Sprint 2 Assigned during Sprint 2 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Data-Groups The name of the module. labels Mar 20, 2026
Comment thread Sprint-2/debug/recipe.js Outdated
Comment thread Sprint-2/implement/contains.test.js
Comment thread Sprint-2/implement/lookup.test.js Outdated
Comment on lines +53 to +55
// CASE 2: Should return an empty object if empty array is passed
test(`should return an empty object if the array is empty`, () =>
expect(createLookup([[]])).toEqual({}));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The first argument is not quite an empty array; it is "an array containing an empty array".

For this input, your function actually returns { undefined: undefined } instead of {}, but toEqual() consider them equal because it ignores property named "undefined". A stricter comparison .toStrictEqual() would have flagged them as an error.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks.
Yes that is absolutely right. Do you think that I should always use toStrictEqual in all the test cases?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes. I think .toStrictEqual() is better when comparing objects.

Comment thread Sprint-2/implement/querystring.js
Comment thread Sprint-2/stretch/count-words.js Outdated
Comment thread Sprint-2/stretch/mode.js Outdated
Comment thread Sprint-2/stretch/till.js Outdated
@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 25, 2026
@MehrozMunir
Copy link
Copy Markdown
Author

@cjyuan
Thank you for the feedback. I have implemented the changes and pushed the latest code. Kindly check, please.

@MehrozMunir MehrozMunir added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 27, 2026
Comment thread Sprint-2/debug/recipe.js
Comment thread Sprint-2/implement/contains.test.js
Comment thread Sprint-2/stretch/mode.js Outdated
Comment thread Sprint-2/stretch/mode.js Outdated
Comment thread Sprint-2/stretch/count-words.js Outdated
Comment on lines +43 to +45
.replace(/\s+/g, " ");

cleanText.split(" ").forEach((word) => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Note: We can also use regex with .split(), and combine the operation on line 43 and 45 as:

  cleanText.split(/\s+/).forEach((word) => {

@cjyuan cjyuan removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 27, 2026
@MehrozMunir
Copy link
Copy Markdown
Author

@cjyuan Thank you for the feedback. I have made changes in mode.js, mode.test.js, and count-words.js files and pushed the latest code after your feedback.

@MehrozMunir MehrozMunir added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 29, 2026
@cjyuan
Copy link
Copy Markdown
Contributor

cjyuan commented Mar 29, 2026

Changes look good.

@cjyuan cjyuan 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. Reviewed Volunteer to add when completing a review with trainee action still to take. labels Mar 29, 2026
@illicitonion
Copy link
Copy Markdown
Member

Closing PR because the January ITP run has finished. Feel free to re-open if you're still working on it.

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. Module-Data-Groups The name of the module. 📅 Sprint 2 Assigned during Sprint 2 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants