Skip to content

Sheffield | ITP-Jan-26 | Hayriye Saricicek | Sprint 3 | practice tdd#1237

Open
mshayriyesaricicek wants to merge 17 commits intoCodeYourFuture:mainfrom
mshayriyesaricicek:Sprint-3-practice-tdd
Open

Sheffield | ITP-Jan-26 | Hayriye Saricicek | Sprint 3 | practice tdd#1237
mshayriyesaricicek wants to merge 17 commits intoCodeYourFuture:mainfrom
mshayriyesaricicek:Sprint-3-practice-tdd

Conversation

@mshayriyesaricicek
Copy link

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 is to practice writing tests before writing functions

@mshayriyesaricicek mshayriyesaricicek added 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 10, 2026
@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
@mshayriyesaricicek mshayriyesaricicek added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Mar 14, 2026
Comment on lines +27 to +31
expect(countChar("aaaaa", 'b")).toEqual(5);
expect(countChar("blind", 'a)).toEqual(0);
expect(countChar("blood", 'o")).toEqual(2);
expect(countChar("bbbrf", 'b")).toEqual(3);
expect(countChar("ooooa", 'o")).toEqual(4);
Copy link
Contributor

Choose a reason for hiding this comment

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

Indentation is off.

Copy link
Author

Choose a reason for hiding this comment

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

I noticed I had syntax errors with the quotes and when I changed it then saved the file Prettier changed the indentation.

Copy link
Contributor

Choose a reason for hiding this comment

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

Note: In VSCode, when a JS file ha syntax errors, its name is usually shown in red color in the Explorer view.

@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 15, 2026
@mshayriyesaricicek mshayriyesaricicek added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Mar 15, 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.

Changes look good.

I have a few more suggestions.

function getOrdinalNumber(num) {
return "1st";
// Check if input is a number
if (!Number.isInteger(num) || !Number.isFinite(num) || num <= 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

  • Number.isFinite() is also redundant

  • Good thinking about rejecting negative numbers. In some context such as in math, the ordinal number of 0 is 0th.

// For numbers that don't end in 1 (not11), 2 and 3
// the function should return a string by appending "th" to the number.

test("should append 'th' if number is 11, 12 or 13 or does not end in 1, 2 or 3",() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

This group should also include numbers ending with 11, 12, or 13 (not just that three numbers).
A direct listing of all the trailing digits in the description might be easier to read:
should append 'th' for numbers ending with 0, 4, 5, 6, 7, 8, 9, 11, 12, or 13

Copy link
Author

Choose a reason for hiding this comment

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

Ive changed it.

@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 15, 2026
@mshayriyesaricicek mshayriyesaricicek added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Mar 16, 2026
@cjyuan
Copy link
Contributor

cjyuan commented Mar 16, 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. labels Mar 16, 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants