Sheffield | 26-ITP-Jan | Mahmoud Shaabo | Sprint 3 | Practice TDD#1214
Sheffield | 26-ITP-Jan | Mahmoud Shaabo | Sprint 3 | Practice TDD#1214mahmoudshaabo1984 wants to merge 2 commits intoCodeYourFuture:mainfrom
Conversation
cjyuan
left a comment
There was a problem hiding this comment.
-
Code looks good. I just have some suggestions for some of the test descriptions.
-
You missed updating
count.test.js.
| test("should append 'th' for 11, 12, and 13", () => { | ||
| expect(getOrdinalNumber(11)).toEqual("11th"); | ||
| expect(getOrdinalNumber(12)).toEqual("12th"); | ||
| expect(getOrdinalNumber(13)).toEqual("13th"); | ||
| }); |
There was a problem hiding this comment.
Could better update the description and include tests to cover "numbers ending with 11, 12, 13" and not just the three numbers, 11, 12, 13.
| test("should append 'th' for other numbers", () => { | ||
| expect(getOrdinalNumber(4)).toEqual("4th"); | ||
| expect(getOrdinalNumber(10)).toEqual("10th"); | ||
| }); |
There was a problem hiding this comment.
When a test fails with the message "... other numbers", it may be unclear what "other numbers" actually refers to.
Can you revise the test description to make it more informative?
|
In the PR description, the checkboxes are currently marked as |
|
Hi CJ, Thank you for the detailed review and for pointing those out! I appreciate the feedback. I have just pushed the updates:
Could you please take another look when you have a moment? Thanks again! |
cjyuan
left a comment
There was a problem hiding this comment.
Changes look good. Well done.
Note: In the PR description, the checkboxes are currently only marked as [x] in Markdown instead of as - [x].
- [x] is the proper syntax in Markdown for checked checkbox.
[x] I have tested my changes
[x] My changes follow the style guide
[x] I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
[x] My changes meet the requirements of the task
PR Title:
Sheffield | 26-ITP-Jan | Mahmoud Shaabo | Sprint 3 | Practice TDD
Summary of work:
Completed all mandatory TDD exercises in the 2-practice-tdd directory.
Successfully implemented logic for the following using TDD (Red-Green-Refactor):
count.js: Created a function to count occurrences of a character in a string.
repeat-str.js: Implemented string repetition with a guard clause for negative numbers and the .repeat() method.
get-ordinal-number.js: Solved the complex logic for English ordinal numbers, including specific handling for 11th, 12th, and 13th.
Verified that all 5 tests passed successfully using npm test.
Personal Note for CJ:
Hi CJ,
Following your previous feedback, I have ensured that all checkboxes now use the correct - [x] syntax.
This "Practice TDD" assignment was a significant milestone for me. Navigating the test failures with NVDA and then writing the logic to make them pass helped me deeply understand the TDD cycle. I'm especially pleased with how I handled the edge cases for the ordinal numbers!
Best regards,
Mahmoud Shaabo