Glasgow | 26-ITP-JAN | Prakash Dcosta | Sprint 3 | Practice TDD#1175
Glasgow | 26-ITP-JAN | Prakash Dcosta | Sprint 3 | Practice TDD#1175dcostaprakash wants to merge 2 commits intoCodeYourFuture:mainfrom
Conversation
Self checklist - [X] I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title - [X] My changes meet the requirements of the task - [X] I have tested my changes - [X] My changes follow the [style guide](https://curriculum.codeyourfuture.io/guides/reviewing/style-guide/) ## Changelist Briefly explain your PR. Have made changes to the file as per the coursework
This comment has been minimized.
This comment has been minimized.
cjyuan
left a comment
There was a problem hiding this comment.
-
Function implementation is correct
-
Some test descriptions could be made clearer
| test("should return 0 when the character is not found", () => { | ||
| const str = "hello"; | ||
| const char = "z"; | ||
| const count = countChar(str, char); | ||
| expect(count).toEqual(0); | ||
| }); |
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
There was a problem hiding this comment.
Got it. I have added both the test cases. Thank you
|
Have modified the descriptions in the TDD to make the test cases more clear. Thank you |
|
LGTM. |
|
Closing PR because the January ITP run has finished. Feel free to re-open if you're still working on it. |
Self checklist
Completed all the tasks as per the coursework