Skip to content

Manchester | 26-ITP-Sept | Fatima Rouchi | Sprint 2 | Practice TDD - #1758

Open
fatimarouchi wants to merge 1 commit into
CodeYourFuture:mainfrom
fatimarouchi:coursework/sprint-3-practice-tdd-clean
Open

fatimarouchi wants to merge 1 commit into
CodeYourFuture:mainfrom
fatimarouchi:coursework/sprint-3-practice-tdd-clean

Conversation

@fatimarouchi

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

CYF-1060

@fatimarouchi fatimarouchi added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 26, 2026
@hey-hammad hey-hammad 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 28, 2026

@hey-hammad hey-hammad 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.

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", () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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", () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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", () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

@hey-hammad hey-hammad 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 28, 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