freeCodeCamp / curriculum

The freeCodeCamp curriculum and lesson editor
Creative Commons Attribution Share Alike 4.0 International
81 stars 124 forks source link

Regex - Restrict Possible Usernames requires more refined tests #263

Open Nirajn2311 opened 6 years ago

Nirajn2311 commented 6 years ago

Describe the bug

In the regex challenge - Restrict possible usernames, when you make the regex expression as follows:

let userCheck = /[A-Za-z][A-Za-z]/; //Let this be Case 1
or
let userCheck = /^[A-Za-z]\w+/; //Let this be Case 2 

The test passes but in Case 1 its supposed to check for numbers in the end and in Case 2 if the input is A2 or e3 it passes.

To Reproduce

Steps to reproduce the behavior:

  1. Go to Restrict possible usernames
  2. Replace line 2 with any of the above two cases.
  3. Click Run the Tests
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

The tests are not supposed to pass.

Screenshots

If applicable, add screenshots to help explain your problem. Case 1 regexr link - Case1 Case 2 regexr link - Case2

Desktop (please complete the following information):

Additional context

I think that the description should be updated to tell the user whether the Usernames will include symbols or not and there should be more tests for this challenge.

ojeytonwilliams commented 6 years ago

Hey, I can take a look at this. There definitely need to be a few more tests!

Nirajn2311 commented 6 years ago

@ojeytonwilliams sry for not putting it in the description but I had thought of adding more tests in the this week once I had finished some school work. If you don’t see any PR within a week, you may make one.

ojeytonwilliams commented 6 years ago

Not to worry. I'll check back in a week or so.

On Thu, 23 Aug 2018, 19:59 Niraj Nandish, notifications@github.com wrote:

@ojeytonwilliams https://github.com/ojeytonwilliams sry for not putting it in the description but I had thought of adding more tests in the this week once I had finished some school work. If you don’t see any PR within a week, you may make one.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/freeCodeCamp/curriculum/issues/263#issuecomment-415512390, or mute the thread https://github.com/notifications/unsubscribe-auth/APEdzimeV33YRNDo6riDWKbqCNtZJVLTks5uTu2AgaJpZM4WHY6s .