London | 26-ITP-Jan | Alex Okorefe | Sprint 3 | Practice TDD#1209
Open
Alex-Os-Dev-Lab wants to merge 5 commits intoCodeYourFuture:mainfrom
Open
London | 26-ITP-Jan | Alex Okorefe | Sprint 3 | Practice TDD#1209Alex-Os-Dev-Lab wants to merge 5 commits intoCodeYourFuture:mainfrom
Alex-Os-Dev-Lab wants to merge 5 commits intoCodeYourFuture:mainfrom
Conversation
…nd (count.test.js) add test for zero occurrences
… and negative values
cjyuan
reviewed
Mar 14, 2026
Contributor
cjyuan
left a comment
There was a problem hiding this comment.
-
Function implementation is correct.
-
Tests are comprehensive.
-
Test descriptions are clear.
Well done!
Contributor
There was a problem hiding this comment.
Could consider testing a few more samples in this script - higher chance to detect bugs in code.
The original specification did not clearly state whether the character match should be case-sensitive.
Most people would probably assume that it is, but to demonstrate our understanding or clarify the assumption we made,
we could add test cases to convey this. For examples,
- A case to show that the match is case sensitive
- A case to show that the function is expected to work also for non-alphabets
| @@ -1,5 +1,25 @@ | |||
| function repeatStr() { | |||
| return "hellohellohello"; | |||
| function repeatStr(stringToRepeat, numberOfRepetitions) { | |||
Contributor
There was a problem hiding this comment.
count is a widely recognised name in programming to mean "number of something".
It is shorter to express repetitionCount or just count than numberOfRepetitions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Learners, PR Template
Self checklist
Changelist
Completed exercises in the TDD directory
Questions
No questions at this stage