Skip to content

London | ITP-26-May | Tomislav Dukez | Sprint 3 | Practice TDD - #1445

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

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

Conversation

@tomdu3

@tomdu3 tomdu3 commented Jul 2, 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

Changelist

Add tests and functions for these problems:

  1. count.test.js
  2. repeat-str.test.js
  3. get-ordinal-number.test.js

@tomdu3 tomdu3 added 🏕 Priority Mandatory This work is expected 📅 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 Jul 2, 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 start, but there are still some things to work on

Comment thread Sprint-3/2-practice-tdd/count.js Outdated
Comment thread Sprint-3/2-practice-tdd/get-ordinal-number.js
Comment thread Sprint-3/2-practice-tdd/get-ordinal-number.js
Comment thread Sprint-3/2-practice-tdd/repeat-str.js Outdated
@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. labels Jul 8, 2026
@tomdu3 tomdu3 added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Jul 8, 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.

Using recursion is a good approach for this. Task complete

@LonMcGregor LonMcGregor added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Jul 8, 2026
@illicitonion

Copy link
Copy Markdown
Member

Closing PR because the May ITP run has finished. Feel free to re-open if you're still working on it.

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

Fantastic and clean solution for countChar! Using array methods makes the logic concise and readable. Even without comments, your code is clear and well-structured. Great work—approved!

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is a wonderfully clean and expressive solution! Using array methods like .split() and .filter() makes the logic very readable and easy to follow.

Quick question: while this functional approach is great for readability, what happens if you pass a very large string? Can you think of an alternative way to count characters (like using a loop or for...of) that avoids creating an intermediate 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.

Fantastic test suite! Using Jest (test, expect) and covering clear scenarios like multiple occurrences and zero matches makes the code very robust. Great job

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fantastic implementation! Handling the special cases for 11, 12, and 13 along with robust input validation makes this code exceptionally reliable.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fantastic test suite! Grouping tests into meaningful categories (such as special endings, edge cases, negative numbers, and non-number inputs) provides exceptional test coverage. Great work

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fantastic recursive implementation! Avoiding String.prototype.repeat and using recursion to build the string while properly handling validation and edge cases is brilliant.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fantastic test suite! Covering multiple repetitions, edge cases like 0 and 1, and negative input error handling ensures robust test coverage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed. Module-Structuring-And-Testing-Data The name of the module. 🏕 Priority Mandatory This work is expected 📅 Sprint 3 Assigned during Sprint 3 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants