Skip to content

Conversation

TzeMingHo
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

In the exercises, I wrote tests first, followed by writing functions to fulfill them. Some edge cases were also attempted to be implemented in the tests.

@TzeMingHo TzeMingHo added 📅 Sprint 3 Assigned during Sprint 3 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Sep 24, 2025
@jenny-alexander jenny-alexander self-requested a review October 2, 2025 02:14
@jenny-alexander jenny-alexander 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 2, 2025
Copy link

@jenny-alexander jenny-alexander left a comment

Choose a reason for hiding this comment

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

Great job @TzeMingHo following the principles of TDD. I added a few comments that wll help you write more reliable code.

Choose a reason for hiding this comment

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

It might have been a leftover from debugging, but console logs should be removed before submitting your PR.

Choose a reason for hiding this comment

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

You have written some good tests cases that cover the main cases. However, can you think of some edge cases that should be tested?

  • what if str is not a string (i.e. a number)
  • what if count is not a number (i.e. "2")
  • what if string is empty or null, what should it return?

Choose a reason for hiding this comment

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

Your test case covers the most basic cases - but can you think of some edge cases you should write tests for?

  • what is count is 2.5?
  • what if the count is null or undefined
  • what if the string is an array or an object instead of a string?

Writing tests to cover edge cases will protect your implementation from unexpected situations and make your code more robust.

@jenny-alexander jenny-alexander 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 4, 2025
@TzeMingHo TzeMingHo 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 Oct 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 📅 Sprint 3 Assigned during Sprint 3 of this module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants