Skip to content

London|26-ITP-Sep|Abdennour Hachemi|Sprint 2 |Practice TDD - #1701

Open
AbdennourHachemi wants to merge 12 commits into
CodeYourFuture:mainfrom
AbdennourHachemi:new/coursework/sprint-3-practice-tdd
Open

AbdennourHachemi wants to merge 12 commits into
CodeYourFuture:mainfrom
AbdennourHachemi:new/coursework/sprint-3-practice-tdd

Conversation

@AbdennourHachemi

Copy link
Copy Markdown

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-1060

@AbdennourHachemi AbdennourHachemi added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 13, 2026
@valentina-starr1

Copy link
Copy Markdown

Thanks for working on this..The core exercise implementations look solid overall, but i can see one blocking issue regarding version control configuration that needs to be addressed before merging.

  1. .gitignore Fix (Blocking)
    practice-tdd/.gitignore: Please remove package.json and package-lock.json from .gitignore. These files must be tracked in the repository to maintain consistent dependencies, scripts, and build environments across machines.

  2. Actionable Improvements & Refactoring
    practice-tdd/repeat-str.js: Returning an error string ("Error! negative counts...") on negative inputs differs from idiomatic JS and the exercise intent. Please throw an Error instead (e.g., throw new Error(...)) and update repeat-str.test.js to use expect(() => ...).toThrow().

practice-tdd/get-ordinal-number.js: The regex logic works, but switching to numeric modulo operations (num % 100 and num % 10) would make the branching much clearer and easier to maintain.

practice-tdd/get-ordinal-number.test.js: Consider adding test cases for 3-digit teen exceptions (e.g., 111, 112, 113) to ensure the suffix rules scale properly.

practice-tdd/count.test.js: Minor nit - @jest/globals imports aren't needed since Jest provides them globally, and there's a small typo in numberOfOcurrence (numberOfOccurrence).

Once package.json and package-lock.json are un-ignored and the error-throwing behavior is updated, this should be good to go.

@AbdennourHachemi

Copy link
Copy Markdown
Author

Thanks @valentina , i have fixed my code according to your review . please have a look again and see if anything else needs correction.

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants