London | 26-ITP-Jan | Alex Okorefe | Sprint 3 | Practice TDD#1209
London | 26-ITP-Jan | Alex Okorefe | Sprint 3 | Practice TDD#1209Alex-Os-Dev-Lab wants to merge 5 commits intoCodeYourFuture:mainfrom
Conversation
…nd (count.test.js) add test for zero occurrences
… and negative values
cjyuan
left a comment
There was a problem hiding this comment.
-
Function implementation is correct.
-
Tests are comprehensive.
-
Test descriptions are clear.
Well done!
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) { | |||
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.
|
Closing PR because the January ITP run has finished. Feel free to re-open if you're still working on it. |
Learners, PR Template
Self checklist
Changelist
Completed exercises in the TDD directory
Questions
No questions at this stage