Skip to content

London | 26-ITP-May | Chun Yan Wong | Sprint 3 | practice-TDD#1492

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

London | 26-ITP-May | Chun Yan Wong | Sprint 3 | practice-TDD#1492
cywong-dev wants to merge 7 commits into
CodeYourFuture:mainfrom
cywong-dev:coursework/sprint-3/practice-tdd

Conversation

@cywong-dev

@cywong-dev cywong-dev commented Jul 10, 2026

Copy link
Copy Markdown

Learners, PR Template

Self checklist

[X] I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
[X] My changes meet the requirements of the task
[X] I have tested my changes
[X] My changes follow the style guide

Changelist

Create the JEST test cases for the coursework

Implement logic to return ordinal numbers based on input.
Added tests for ordinal number handling for 2nd, 3rd, th exceptions, and general cases.
Implement repeatStr function to repeat a string a given number of times without using String.prototype.repeat. Handle negative count by throwing an error.
Added test cases for repeatStr function to handle edge cases including count of 1, 0, and negative values.
@github-actions

This comment has been minimized.

@cywong-dev cywong-dev changed the title London | 25-ITP-May | Chun Yan Wonf | Sprint - 1 | Alarm Clock London | 26-ITP-May | Chun Yan Wong | Sprint 3 | practice-TDD Jul 10, 2026
@github-actions

This comment has been minimized.

@cywong-dev cywong-dev 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 Jul 10, 2026

@LonMcGregor LonMcGregor 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 start. Part of TTD is running tests as you write code. Have you been doing that? I got some errors when I ran the tests.

function countChar(stringOfCharacters, findCharacter) {
return 5
let count = 0;
let char = "";

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 does defining the char variable outside of the for loop do here?

// The goal is to re-implement that function, not to use it.
return "hellohellohello";

for (let i = 0; i < count; i++) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Have you tried running the test here. When I run it, I get an error

@LonMcGregor LonMcGregor 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 Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module-Structuring-And-Testing-Data The name of the module. 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