Repository navigation
Manchester | 26-ITP-Sept | Fatima Rouchi | Sprint 2 | Practice TDD - #1758
Open
fatimarouchi wants to merge 1 commit into
Open
fatimarouchi wants to merge 1 commit into
fatimarouchi wants to merge 1 commit into
Conversation
hey-hammad
suggested changes
Oct 28, 2026
hey-hammad
left a comment
There was a problem hiding this comment.
Good work overall, a few test cases needs attention and bug in the count.js needs to be resolved. Thanks
| // Given a string containing exactly one match, | ||
| // When the function is called, | ||
| // Then it should return 1. | ||
| test("should count a single occurrence of a character", () => { |
There was a problem hiding this comment.
Do the test case name and its implementation match?
Consider the function's input: does the word "banana" contain only one occurrence of the letter "n"? Would it make more sense to test a different letter that appears only once in the string, so that the test case name matches its implementation?
| // Given an empty string, | ||
| // When the function is called with any character, | ||
| // Then it should return 0. | ||
| test("should return 0 for an empty string", () => { |
There was a problem hiding this comment.
what happens if I call the function with the following inputs? does it return the correct output?
countChar("abc", "")
| expect(getOrdinalNumber(103)).toEqual("103rd"); | ||
| }); | ||
|
|
||
| test("should append 'th' for all other numbers, including 11, 12 and 13", () => { |
There was a problem hiding this comment.
does this cover "all other numbers"?
Think about the following inputs.
- negative (worth checking even though we're taking the absolute value)
- zero
- boundary cases e.g 111,112, 113
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.
Self checklist
CYF-1060