Skip to content

Birmingham | 26-ITP-JAN | Merve Reis | Sprint 3 | Practice TDD#1124

Open
mervereis wants to merge 5 commits intoCodeYourFuture:mainfrom
mervereis:coursework/sprint-3-practice-tdd
Open

Birmingham | 26-ITP-JAN | Merve Reis | Sprint 3 | Practice TDD#1124
mervereis wants to merge 5 commits intoCodeYourFuture:mainfrom
mervereis:coursework/sprint-3-practice-tdd

Conversation

@mervereis
Copy link

@mervereis mervereis commented Mar 1, 2026

Learners, PR Template

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

Changelist

I added test cases accordingly requirements then added functionality to related files.

@mervereis mervereis added 📅 Sprint 3 Assigned during Sprint 3 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Structuring-And-Testing-Data The name of the module. labels Mar 1, 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.

Functions are good.

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);
});
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 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

Copy link
Author

Choose a reason for hiding this comment

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

@cjyuan I added more test cases

expect(getOrdinalNumber(111)).toEqual("111th");
});

test("should append 'th' for all other numbers", () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

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?

Copy link
Author

Choose a reason for hiding this comment

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

@cjyuan I changed the test title to more informative way, now I specified the exact numbers

@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 10, 2026
@mervereis mervereis added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 10, 2026
@cjyuan
Copy link
Contributor

cjyuan commented Mar 10, 2026

Changes look good. Well done.

@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. Reviewed Volunteer to add when completing a review with trainee action still to take. labels Mar 10, 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. Module-Structuring-And-Testing-Data The name of the module. 📅 Sprint 3 Assigned during Sprint 3 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants