javascript-exercises icon indicating copy to clipboard operation
javascript-exercises copied to clipboard

added alternate repeatString test strings

Open kumang-subba opened this issue 1 year ago • 2 comments

Because

Changes tests for the repeatString function and its solutions to prevent students from hardcoding specific parts of the function.

This PR

  • [x] Each test in repeatString.spec.js has its own unique string that it passes in eg: repeatString(10, "hello"); repeatString(5, "goodbye")
  • [x] The expect() is updated to reflect this new string
  • [x] Test passes
  • [x] solutions and main branch both have these changes

Issue

Closes #200

Additional Information

Mistakely closed #419. @bycdiaz I have changed the double quotes to single quotes. The believe the author in #200 intended every test in the repeatString exercise to take different string, preventing learners for hard-coding. While the latter test with a randomly number prevents learners from solely relying on hardcoded solutions. Incorporating various strings in the preceding tests will effectively discourage hardcoding tendencies among learners and ensure a more comprehensive understanding of the exercise during the early stage.

Pull Request Requirements

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

kumang-subba avatar Jan 07 '24 21:01 kumang-subba

@kumang-subba Looks like there's a tiny merge conflict. can you resolve this and let me know when it's ready?

bycdiaz avatar Feb 09 '24 00:02 bycdiaz

@bycdiaz I have resolved the conflict. Should be good to go now.

kumang-subba avatar Feb 09 '24 11:02 kumang-subba