8000 02_repeatString: Add test preventing use of `String.prototype.repeat` by MaoShizhong · Pull Request #523 · TheOdinProject/javascript-exercises · GitHub
[go: up one dir, main page]

Skip to content

02_repeatString: Add test preventing use of String.prototype.repeat #523

8000
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 11, 2025

Conversation

MaoShizhong
Copy link
Contributor

Because

The instructions for 02_repeatString make it clear that the exercise is for practising loops, so the user must not use the built-in String.prototype.repeat method to complete this, even if it leads to the same result. Despite this, the test suite doesn't actually prevent its usage. It would be worth adding a single test that fails upon its use and explains why, in order to encourage practising loops.

This PR

  • Adds test preventing use of String.prototype.repeat in both main and solution test files

Issue

N/A

Additional Information

Pull Request Requirements

  • I have thoroughly read and understand The Odin Project Contributing Guide
  • The title of this PR follows the location of change: brief description of change format, e.g. 01_helloWorld: Update test cases
  • The Because section summarizes the reason for this PR
  • The This PR section has a bullet point list describing the changes in this PR
  • If this PR addresses an open issue, it is linked in the Issue section
  • If this PR includes any changes that affect the solution of an exercise, I've also updated the solution in the /solutions folder

Copy link
Contributor
@JoshDevHub JoshDevHub left a comment

Choose a reason for hiding this comment

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

🚀

@JoshDevHub JoshDevHub merged commit ace1d6e into TheOdinProject:main Feb 11, 2025
@MaoShizhong MaoShizhong deleted the repeat-string-builtin branch February 11, 2025 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0