Skip to content

London | 26-ITP-Sep | Abakar Souleyman | Sprint 3 | Practice tdd - #1661

Open
abmhts wants to merge 3 commits into
CodeYourFuture:mainfrom
abmhts:coursework/sprint-3-practice-tdd
Open

abmhts wants to merge 3 commits into
CodeYourFuture:mainfrom
abmhts:coursework/sprint-3-practice-tdd

Conversation

@abmhts

@abmhts abmhts commented Oct 8, 2026

Copy link
Copy Markdown

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

Task code

CYF-1060

Changelist

Practice TDD

@abmhts abmhts added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 8, 2026
@hackertainment hackertainment added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Oct 9, 2026

@hackertainment hackertainment left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The code looks good and you are almost there. Please keep it up :-)

Comment on lines +25 to +31
test("should return 0 when character doesn't occur", () => {
const str = "salam";
const char = "b";

const count = countChar(str, char);
expect(count).toEqual(0);
}); No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

There should be another valid boundary case that returns 0. Can you think of it? Please add it back. Thank you.

Comment on lines +33 to +42
// Case 4: Numbers ending with "th" including the special case (11,12,13)
test(`Numbers ending with "th" including the special case (11,12,13)`, () => {
expect(getOrdinalNumber(10)).toEqual("10th");
expect(getOrdinalNumber(11)).toEqual("11th");
expect(getOrdinalNumber(12)).toEqual("12th");
expect(getOrdinalNumber(13)).toEqual("13th");
expect(getOrdinalNumber(14)).toEqual("14th");
expect(getOrdinalNumber(5)).toEqual("5th");
expect(getOrdinalNumber(4)).toEqual("4th");
}); No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This test suite should include more test cases that is greater than 100 and still ended in th. Please add them back. Thank you.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your answers are correct. Just to give you a bit more thinking, besides const str = "hello"; , what special string should also be tested in each of the test suites?

@hackertainment hackertainment added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants