Skip to content

London | 26-ITP-Sept | Hugh Mills | Sprint 2 | Sprint 2 coursework - #1518

Open
HM-127BTY wants to merge 34 commits into
CodeYourFuture:mainfrom
HM-127BTY:Sprint-2
Open

HM-127BTY wants to merge 34 commits into
CodeYourFuture:mainfrom
HM-127BTY:Sprint-2

Conversation

@HM-127BTY

@HM-127BTY HM-127BTY commented Nov 12, 2026 •

Copy link
Copy Markdown

Learners, PR Template

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

Task code

CYF-1083

Changelist

Worked on tests and fixing code as requested for coursework

@HM-127BTY HM-127BTY 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. labels Nov 12, 2026
@LonMcGregor LonMcGregor added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Nov 16, 2026
Comment thread Sprint-2/implement/contains.js Outdated
Comment on lines +2 to +5
if (Array.isArray(object)) {
throw new Error("contains requires an object");
}
return property in object;

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 stated invalid inputs also include strings, numbers, null, and no argument. What error does this guard produce for those calls?

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

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.

for anything that is an array and not an object.

Comment thread Sprint-2/implement/querystring.js Outdated
Comment on lines +14 to +15
const key = decodeURIComponent(parts[0]);
const value = decodeURIComponent(parts.slice(1).join("="));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What key and value does this parsing produce for the existing full+name=John+Doe test case?

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

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.

"full name": "John Doe"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Please actually run the tests in Node JS and fix test case which cannot be passed. Thank you.

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.

ah I see I missed some there, think I was burnt out tired when I was doing it.

Got it fixed and done the stretch aswell so the tests are passing.

Comment thread Sprint-2/debug/author.js
Comment on lines +2 to +3
// value is undefined, its not seen in the code at all.
// Ah error said it is not iterable, i didnt spot the for...of loop there, so its not seeing the value as an option in the object.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

When the loop starts with the plain author object, does it ever assign a value to value?

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

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.

No it does not.

Comment thread Sprint-2/debug/recipe.js
// Predict and explain first...

// it does not make a new line as just pressing enter wont work for that.
// I was wrong, ingredients is showing [object Object], as it wont log out a full object like this.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

In the original template, which expression was interpolated at the spot that produced [object Object]?

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

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.

it was at line 15:
${recipe}`);

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

@HM-127BTY HM-127BTY added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Nov 21, 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. Reviewed Volunteer to add when completing a review with trainee action still to take. labels Nov 21, 2026

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

The code actually looks quite good. The major improvements should be test cases coverage. Please keep it up. Thank you.

// Then it should throw Error("contains requires an object")
// (careful: typeof [] and typeof null are both "object")
test("Given an array, throws an error 'contains requires an object'", () => {
expect(() => contains([])).toThrow("contains requires an object");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Please read the requirement carefully. Only one test case is not enough to meet this requirement. Please add more test cases for this particular category. Thank you.

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.

A h yeah I see it now. Misunderstanding on my side.
Added in the extra tests and sorted out the code for it.

Comment thread Sprint-2/implement/querystring.js Outdated
Comment on lines +14 to +15
const key = decodeURIComponent(parts[0]);
const value = decodeURIComponent(parts.slice(1).join("="));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Please actually run the tests in Node JS and fix test case which cannot be passed. Thank you.

// When passed to tally
// Then it should throw Error("tally requires an array")
test("WGiven an invalid input should throw error 'tally requires an array'", () => {
expect(() => tally("im a string")).toThrow("tally requires an array");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Please read the requirement carefully. Only one test case is not enough to meet this requirement. Please add more test cases for this particular category. Thank you.

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.

I see it was the same mistake as the other... rushing to much to get stuff done and not reading it.

Added in the tests and they seem to be working well.

@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 21, 2026
@HM-127BTY HM-127BTY added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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. 📅 Sprint 2 Assigned during Sprint 2 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants