Skip to content

London | 26-ITP-May | Ebrahim Moqbel | sprint 2 | course work - #1420

Open
Ebrahim-Moqbel wants to merge 4 commits into
CodeYourFuture:mainfrom
Ebrahim-Moqbel:coursework-sprint-2
Open

London | 26-ITP-May | Ebrahim Moqbel | sprint 2 | course work#1420
Ebrahim-Moqbel wants to merge 4 commits into
CodeYourFuture:mainfrom
Ebrahim-Moqbel:coursework-sprint-2

Conversation

@Ebrahim-Moqbel

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

Changelist

completed the debug , implement and interpret file buy building the functions and interpreting the requirements of the test cases.

Questions

N/A

@Ebrahim-Moqbel Ebrahim-Moqbel 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 Aug 10, 2026
@Poonam-raj Poonam-raj 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 11, 2026
Comment on lines +2 to +9
describe('createLookup',()=>{
test("creates a country currency code lookup for multiple codes",()=>{
const arrayInput=[['US', 'USD'], ['CA', 'CAD']]
expect(createLookup(arrayInput)).toEqual({US: 'USD',CA:"CAD"})
});


})

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

With Test Driven Development (TDD) I would want maybe another test to come before this one. A smaller test with a simpler and different input to prove that the test was built up carefully and that the function can handle different inputs and is not hard coded

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.

Thank you Poonam-raj,
I will be considering building up my tests gradually next time

Comment on lines -23 to -24
expect(parseQueryString("key")).toEqual({ key: "" });
expect(parseQueryString("key=")).toEqual({ key: "" });

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 was your thinking when removing these two test assertions?

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.

the test was throwing an error of this two cases. I deleted them and forget to write them back.

Comment thread Sprint-2/implement/tally.test.js Outdated
// When passed to tally
// Then it should throw an error
test('tally with invalid input like a string, throw an error', ()=>{
expect(()=>tally("")).toThrow(Error)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

For accuracy in the code, it makes sense to expect a TypeError here as that's the behaviour you've created in the code.

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.

thank you will be updating this accordingly

Comment on lines +26 to +28
// It returns an array of [key,value] pairs as two elements array and was used to return the object into enumerable array
// d) Explain why the current return value is different from the target output

// the function contain a bug as the dot notation here was overwriting the object in the loop also the return is not swapping the input

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice accurate explanations here

Comment on lines +31 to +41
function invert(obj) {


const invertedObj = {};

for (const [key, value] of Object.entries(obj)) {
invertedObj[value] = key;
}

return invertedObj;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

fabulous

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

A few comments and one question from my side in the feedback. Some great work here though

@Poonam-raj Poonam-raj added Complete Volunteer to add when work is complete and all review comments have been addressed. 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. Complete Volunteer to add when work is complete and all review comments have been addressed. labels Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module-Data-Groups The name of the module. 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.

2 participants