Skip to content
This repository has been archived by the owner on Sep 25, 2019. It is now read-only.

fix(challenges): update regular expression that fails #56

Merged
merged 3 commits into from
Jun 29, 2018

Conversation

matthew-t-smith
Copy link
Contributor

@matthew-t-smith matthew-t-smith commented Jun 26, 2018

Changes regular expression in testString to remove negative look behind that is not implemented
across all browsers.

ISSUES CLOSED: #55

Pre-Submission Checklist

  • Your pull request targets the staging branch of freeCodeCamp.
    Targets new dev branch of curriculum
  • Branch starts with either fix/, feature/, or translate/ (e.g. fix/signin-issue)
  • You have only one commit (if not, squash them into one commit).
  • All new and existing tests pass the command npm test. Use git commit --amend to amend any fixes.

Type of Change

  • Small bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds new functionality)
  • Breaking change (fix or feature that would change existing functionality)
  • Add new translation (feature adding new translations)

Checklist:

  • Tested changes locally.
  • Addressed currently open issue (replace XXXXX with an issue no in next line)

Closes #55
freeCodeCamp/freeCodeCamp#17387

Description

This replicates a PR that was closed on freeCodeCamp (noted in the Issue #55 ) in order to remove a negative look behind used in the regular expression in a test. This is not fully implemented in Firefox yet, but the new expression should take care of the testing as it should.

Changes regular expression in testString to remove negative look behind that is not implemented
across all browsers.

ISSUES CLOSED: freeCodeCamp#55
@matthew-t-smith
Copy link
Contributor Author

@raisedadead @scissorsneedfoodtoo Here is the new issue & PR duplicating what we did over on freeCodeCamp. Let me know if there's anything else you need!

@scissorsneedfoodtoo
Copy link
Contributor

@matthew-t-smith, thank you for moving your PR to this repo!

I'm sorry, there's just one thing I noticed. Not sure why, but a lot of the spacing was added to the tests objects. Maybe one of the tests or a linter added all of these line breaks? Unfortunately, I'm not sure if we can merge this as the formatting is quite a bit different than the other seed files.

This isn't the challenge you're updating, but here's an example of the format for the tests.

      "tests": [
        {
          "text": "Your code should use <code>console.log()</code> to check the value of the variable <code>a</code>.",
          "testString": "assert(code.match(/console\\.log\\(a\\)/g), 'Your code should use <code>console.log()</code> to check the value of the variable <code>a</code>.');"
        }
      ],

Would you be able to update this pull request so that the tests look like the one above, without all of the line breaks?

It is definitely something to do with a linter. I re-ran the `npm run commit` in my own environment and watched the line spacing jump. Should probably be checked if it ends up happening to others. However, this should fix it all for this PR!
@matthew-t-smith
Copy link
Contributor Author

@scissorsneedfoodtoo I just updated removing all the line breaks. It was happening during the npm run commit on my computer. It has something to do with the character length of each line. Shorter titles and test strings didn't jump.

However, now my Travis CI has 1 failing check. I'll look into this evening.

@scissorsneedfoodtoo
Copy link
Contributor

@matthew-t-smith, you're right, I checked on my local machine and the same happens automatically. I checked some other challenge files and you're right--shorter titles and test strings are all on the same line. Sorry about that! Didn't realize until now.

Could you roll back to your previous commit, or just run npm run commit again to get things back the way they were? I'm sorry again for all the trouble.

@raisedadead
Copy link
Member

We have turned on prettier formatting. Its worth investigating if this is okay or not for certain files. Is the spacing an issue on the final outputs?

@scissorsneedfoodtoo
Copy link
Contributor

scissorsneedfoodtoo commented Jun 28, 2018

@raisedadead, good point. Seems like a lot of the basic Javascript challenges were formatted that way. I can take a quick look and see if the spacing is an issue before @matthew-t-smith makes any further changes.

@scissorsneedfoodtoo
Copy link
Contributor

@raisedadead, I checked out a handful of challenges with the new prettier formatting and it doesn't seem to affect the final output at all--the pages over on Learn look as they should.

@matthew-t-smith, could you go back the initial formatting you had? Sorry again for all the trouble!

Reverting back to pretty formatting from commit.
@matthew-t-smith
Copy link
Contributor Author

@scissorsneedfoodtoo This should be back to what the initial commit showed - added line spacing from the prettier formatting but with the regex changed.

@scissorsneedfoodtoo
Copy link
Contributor

@matthew-t-smith, awesome! That was so fast. Thank you again for making all of these changes and going back and forth like that. Everything LGTM 👍

@scissorsneedfoodtoo scissorsneedfoodtoo merged commit b186dc9 into freeCodeCamp:dev Jun 29, 2018
raisedadead pushed a commit that referenced this pull request Jun 29, 2018
* fix(challenges): update regular expression that fails

Changes regular expression in testString to remove negative look behind that is not implemented
across all browsers.

ISSUES CLOSED: #55

* Fixed line spacing

It is definitely something to do with a linter. I re-ran the `npm run commit` in my own environment and watched the line spacing jump. Should probably be checked if it ends up happening to others. However, this should fix it all for this PR!

* Back to `prettier` formatting

Reverting back to pretty formatting from commit.
raisedadead pushed a commit that referenced this pull request Jun 29, 2018
* fix(challenges): update regular expression that fails

Changes regular expression in testString to remove negative look behind that is not implemented
across all browsers.

ISSUES CLOSED: #55

* Fixed line spacing

It is definitely something to do with a linter. I re-ran the `npm run commit` in my own environment and watched the line spacing jump. Should probably be checked if it ends up happening to others. However, this should fix it all for this PR!

* Back to `prettier` formatting

Reverting back to pretty formatting from commit.
raisedadead pushed a commit that referenced this pull request Jun 29, 2018
* fix(challenges): update regular expression that fails

Changes regular expression in testString to remove negative look behind that is not implemented
across all browsers.

ISSUES CLOSED: #55

* Fixed line spacing

It is definitely something to do with a linter. I re-ran the `npm run commit` in my own environment and watched the line spacing jump. Should probably be checked if it ends up happening to others. However, this should fix it all for this PR!

* Back to `prettier` formatting

Reverting back to pretty formatting from commit.
raisedadead pushed a commit that referenced this pull request Jun 29, 2018
# [3.0.0](v2.0.0...v3.0.0) (2018-06-29)

### Bug Fixes

* **challenge:** Fixed the typo for automatically ([#48](#48)) ([dd046d6](dd046d6))
* **challenge:** Updated tests to avoid confusion ([#57](#57)) ([7105507](7105507))
* **challenges:** change test for template literals challenge ([#37](#37)) ([4b1c5eb](4b1c5eb))
* **challenges:** cherry pick pr 17664 & 17672 from main repo ([#52](#52)) ([2375d0c](2375d0c))
* **challenges:** fixed telephone number validator project ([#53](#53)) ([2b034e2](2b034e2)), closes [#47](#47)
* **challenges:** fixed typo in css-grid.json ([#46](#46)) ([e74192e](e74192e))
* **challenges:** grammar fix in css-grid auto-fit challenge ([#60](#60)) ([a6a0266](a6a0266))
* **challenges:** Typo errors ([#39](#39)) ([0c0702d](0c0702d))
* **challenges:** update regular expression that fails ([#56](#56)) ([9fa5907](9fa5907)), closes [#55](#55)

### BREAKING CHANGES

* **challenges:** None
raisedadead pushed a commit that referenced this pull request Jun 29, 2018
# [3.0.0](v2.0.0...v3.0.0) (2018-06-29)

### Bug Fixes

* **challenge:** Fixed the typo for automatically ([#48](#48)) ([dd046d6](dd046d6))
* **challenge:** Updated tests to avoid confusion ([#57](#57)) ([7105507](7105507))
* **challenges:** change test for template literals challenge ([#37](#37)) ([4b1c5eb](4b1c5eb))
* **challenges:** cherry pick pr 17664 & 17672 from main repo ([#52](#52)) ([2375d0c](2375d0c))
* **challenges:** fixed telephone number validator project ([#53](#53)) ([2b034e2](2b034e2)), closes [#47](#47)
* **challenges:** fixed typo in css-grid.json ([#46](#46)) ([e74192e](e74192e))
* **challenges:** grammar fix in css-grid auto-fit challenge ([#60](#60)) ([a6a0266](a6a0266))
* **challenges:** Typo errors ([#39](#39)) ([0c0702d](0c0702d))
* **challenges:** update regular expression that fails ([#56](#56)) ([9fa5907](9fa5907)), closes [#55](#55)

### BREAKING CHANGES

* **challenges:** None
anku255 pushed a commit to anku255/curriculum that referenced this pull request Jun 30, 2018
* fix(challenges): update regular expression that fails

Changes regular expression in testString to remove negative look behind that is not implemented
across all browsers.

ISSUES CLOSED: freeCodeCamp#55

* Fixed line spacing

It is definitely something to do with a linter. I re-ran the `npm run commit` in my own environment and watched the line spacing jump. Should probably be checked if it ends up happening to others. However, this should fix it all for this PR!

* Back to `prettier` formatting

Reverting back to pretty formatting from commit.
anku255 pushed a commit to anku255/curriculum that referenced this pull request Jun 30, 2018
# [3.0.0](freeCodeCamp/curriculum@v2.0.0...v3.0.0) (2018-06-29)

### Bug Fixes

* **challenge:** Fixed the typo for automatically ([freeCodeCamp#48](freeCodeCamp#48)) ([dd046d6](freeCodeCamp@dd046d6))
* **challenge:** Updated tests to avoid confusion ([freeCodeCamp#57](freeCodeCamp#57)) ([7105507](freeCodeCamp@7105507))
* **challenges:** change test for template literals challenge ([freeCodeCamp#37](freeCodeCamp#37)) ([4b1c5eb](freeCodeCamp@4b1c5eb))
* **challenges:** cherry pick pr 17664 & 17672 from main repo ([freeCodeCamp#52](freeCodeCamp#52)) ([2375d0c](freeCodeCamp@2375d0c))
* **challenges:** fixed telephone number validator project ([freeCodeCamp#53](freeCodeCamp#53)) ([2b034e2](freeCodeCamp@2b034e2)), closes [freeCodeCamp#47](freeCodeCamp#47)
* **challenges:** fixed typo in css-grid.json ([freeCodeCamp#46](freeCodeCamp#46)) ([e74192e](freeCodeCamp@e74192e))
* **challenges:** grammar fix in css-grid auto-fit challenge ([freeCodeCamp#60](freeCodeCamp#60)) ([a6a0266](freeCodeCamp@a6a0266))
* **challenges:** Typo errors ([freeCodeCamp#39](freeCodeCamp#39)) ([0c0702d](freeCodeCamp@0c0702d))
* **challenges:** update regular expression that fails ([freeCodeCamp#56](freeCodeCamp#56)) ([9fa5907](freeCodeCamp@9fa5907)), closes [freeCodeCamp#55](freeCodeCamp#55)

### BREAKING CHANGES

* **challenges:** None
@matthew-t-smith matthew-t-smith deleted the fix/55 branch June 30, 2018 23:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regular Expression Error in Test for Debugging Challenge
3 participants