Skip to content

Glasgow| 26-ITP-Jan | Alasdair MacDonald | Sprint 3 | Practice TDD#1165

Open
MacDonald91 wants to merge 1 commit intoCodeYourFuture:mainfrom
MacDonald91:coursework/sprint-3-practice-tdd
Open

Glasgow| 26-ITP-Jan | Alasdair MacDonald | Sprint 3 | Practice TDD#1165
MacDonald91 wants to merge 1 commit intoCodeYourFuture:mainfrom
MacDonald91:coursework/sprint-3-practice-tdd

Conversation

@MacDonald91
Copy link

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

Completed all tasks in sprint 3 part TDD, the second time uploading to GitHub, a JSON file was included in the last upload; made sure this time it didn't include the file.

Questions

No questions at this time.

@MacDonald91 MacDonald91 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 4, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 4, 2026
@github-actions

This comment has been minimized.

@MacDonald91 MacDonald91 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 4, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 4, 2026
@MacDonald91 MacDonald91 force-pushed the coursework/sprint-3-practice-tdd branch from 273a8e0 to d4e4a58 Compare March 4, 2026 15:56
@MacDonald91 MacDonald91 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 are good.

Comment on lines +49 to +53
test("should append 'th' for all other numbers", () => {
expect(getOrdinalNumber(4)).toEqual("4th");
expect(getOrdinalNumber(10)).toEqual("10th");
expect(getOrdinalNumber(100)).toEqual("100th");
}); No newline at end of file
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?

Comment on lines +26 to +31
test("should return 0 when the character does not exist in the string", () => {
const str = "hello";
const char = "z";
const count = countChar(str, char);
expect(count).toEqual(0);
}); No newline at end of file
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 and 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

@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 13, 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