Skip to content

London | 26-ITP-May | Gideon Defar | Sprint 3 |Coursework/sprint 3 practice tdd - #1596

Open
gideondefar wants to merge 6 commits into
CodeYourFuture:mainfrom
gideondefar:coursework/sprint-3-practice-tdd
Open

London | 26-ITP-May | Gideon Defar | Sprint 3 |Coursework/sprint 3 practice tdd#1596
gideondefar wants to merge 6 commits into
CodeYourFuture:mainfrom
gideondefar:coursework/sprint-3-practice-tdd

Conversation

@gideondefar

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

Changelist

Implemented and tested the Sprint 3 TDD exercises using Jest.

The changes include:

Added Jest tests for countChar and implemented the function to count character occurrences.
Added Jest tests for repeatStr, including multiple repetitions, count of 1, count of 0, and negative counts.
Implemented repeatStr without using String.prototype.repeat.
Added Jest tests for getOrdinalNumber, covering different ordinal-number categories and special cases such as 11th, 12th, and 13th.
Implemented the required functions to make the tests pass.
Ran the tests using Jest and verified the expected behaviour.

@gideondefar gideondefar added 📅 Sprint 3 Assigned during Sprint 3 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Structuring-And-Testing-Data The name of the module. labels Aug 1, 2026
@LonMcGregor LonMcGregor added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Aug 1, 2026

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

Good work, just one of your implementations needs changing

// When the repeatStr function is called with these inputs,
// Then it should throw an error, as negative counts are not valid.

test("should throw an error when count is negative", () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Does this last test pass?

@LonMcGregor LonMcGregor 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. Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module-Structuring-And-Testing-Data The name of the module. Reviewed Volunteer to add when completing a review with trainee action still to take. 📅 Sprint 3 Assigned during Sprint 3 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants