Skip to content

Sheffield | 26-ITP-jan | Richard Frimpong | Sprint 3 | Practice TDD#1153

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

Sheffield | 26-ITP-jan | Richard Frimpong | Sprint 3 | Practice TDD#1153
Richiealx wants to merge 3 commits intoCodeYourFuture:mainfrom
Richiealx:coursework/sprint-3-practice-tdd

Conversation

@Richiealx
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

This PR completes the Sprint 3 Practice TDD coursework.

Implemented functionality

  • Implemented getOrdinalNumber following TDD principles.
  • Added logic to correctly return ordinal suffixes:
    • st for numbers ending in 1 (except 11)
    • nd for numbers ending in 2 (except 12)
    • rd for numbers ending in 3 (except 13)
    • th for all other numbers.

Tests

Jest tests were written and run to verify the implementation.

Tests executed using:

  • npx jest Sprint-3/2-practice-tdd
  • All tests pass successfully

@Richiealx Richiealx 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.

There are 6 files to be modified in this exercise. Currently there are only 2 modified files on this branch.

@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 6, 2026
@Richiealx
Copy link
Author

There are 6 files to be modified in this exercise. Currently there are only 2 modified files on this branch.

Hi @cjyuan,

Thanks for the feedback.

I have now completed the Sprint-3/2-practice-tdd task across all 6 files in the folder:

  • count.js
  • count.test.js
  • repeat-str.js
  • repeat-str.test.js
  • get-ordinal-number.js
  • get-ordinal-number.test.js

I ran:

npx jest Sprint-3/2-practice-tdd

and all tests passed.

I pushed the fixes to the same branch.

@Richiealx Richiealx added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 12, 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.

Looks good. Well done.

Copy link
Contributor

Choose a reason for hiding this comment

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

These are also some good 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 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 12, 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