Birmingham | 26-ITP-JAN | Merve Reis | Sprint 3 | Practice TDD#1124
Open
mervereis wants to merge 5 commits intoCodeYourFuture:mainfrom
Open
Birmingham | 26-ITP-JAN | Merve Reis | Sprint 3 | Practice TDD#1124mervereis wants to merge 5 commits intoCodeYourFuture:mainfrom
mervereis wants to merge 5 commits intoCodeYourFuture:mainfrom
Conversation
cjyuan
reviewed
Mar 10, 2026
Comment on lines
+26
to
+31
| test("should return 0 when character does not exist in the string", () => { | ||
| const str = "hello world"; | ||
| const char = "x"; | ||
| const count = countChar(str, char); | ||
| expect(count).toEqual(0); | ||
| }); |
Contributor
There was a problem hiding this comment.
-
Could consider testing more samples.
-
Could consider testing these cases:
- 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
| expect(getOrdinalNumber(111)).toEqual("111th"); | ||
| }); | ||
|
|
||
| test("should append 'th' for all other numbers", () => { |
Contributor
There was a problem hiding this comment.
When a test fails with the message "... all other numbers", it may be unclear what "other numbers" actually refers to. Can you revise the test description to make it more informative?
Author
There was a problem hiding this comment.
@cjyuan I changed the test title to more informative way, now I specified the exact numbers
Contributor
|
Changes look good. Well done. |
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
I added test cases accordingly requirements then added functionality to related files.