Glasgow| 26-ITP-Jan | Alasdair MacDonald | Sprint 3 | Practice TDD#1165
Open
MacDonald91 wants to merge 1 commit intoCodeYourFuture:mainfrom
Open
Glasgow| 26-ITP-Jan | Alasdair MacDonald | Sprint 3 | Practice TDD#1165MacDonald91 wants to merge 1 commit intoCodeYourFuture:mainfrom
MacDonald91 wants to merge 1 commit intoCodeYourFuture:mainfrom
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
273a8e0 to
d4e4a58
Compare
cjyuan
reviewed
Mar 13, 2026
Contributor
cjyuan
left a comment
There was a problem hiding this comment.
Function implementation are good.
Comment on lines
+49
to
+53
| test("should append 'th' for all other numbers", () => { | ||
| expect(getOrdinalNumber(4)).toEqual("4th"); | ||
| expect(getOrdinalNumber(10)).toEqual("10th"); | ||
| expect(getOrdinalNumber(100)).toEqual("100th"); | ||
| }); No newline at end of file |
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?
Comment on lines
+26
to
+31
| test("should return 0 when the character does not exist in the string", () => { | ||
| const str = "hello"; | ||
| const char = "z"; | ||
| const count = countChar(str, char); | ||
| expect(count).toEqual(0); | ||
| }); No newline at end of file |
Contributor
There was a problem hiding this comment.
- Could consider testing more samples and 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
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 all tasks in sprint 3 part TDD, the second time uploading to GitHub, a JSON file was included in the last upload; made sure this time it didn't include the file.
Questions
No questions at this time.