Skip to content

Glasgow | 26-ITP-JAN | Prakash Dcosta | Sprint 3 | Practice TDD#1175

Open
dcostaprakash wants to merge 2 commits intoCodeYourFuture:mainfrom
dcostaprakash:coursework/sprint-3-practice-tdd
Open

Glasgow | 26-ITP-JAN | Prakash Dcosta | Sprint 3 | Practice TDD#1175
dcostaprakash wants to merge 2 commits intoCodeYourFuture:mainfrom
dcostaprakash:coursework/sprint-3-practice-tdd

Conversation

@dcostaprakash
Copy link

@dcostaprakash dcostaprakash commented Mar 4, 2026

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Completed all the tasks as per the coursework

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
@github-actions

This comment has been minimized.

@dcostaprakash dcostaprakash added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 4, 2026
Copy link
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Function implementation is correct

  • Some test descriptions could be made clearer

Comment on lines +25 to +30
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);
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. I have added both the test cases. Thank you

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Mar 14, 2026
@dcostaprakash
Copy link
Author

Have modified the descriptions in the TDD to make the test cases more clear. Thank you

@dcostaprakash dcostaprakash added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Mar 14, 2026
@cjyuan
Copy link
Contributor

cjyuan commented Mar 15, 2026

LGTM.

@cjyuan cjyuan added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants