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

fix(challenges): change test for template literals challenge #37

Conversation

scissorsneedfoodtoo
Copy link
Contributor

@scissorsneedfoodtoo scissorsneedfoodtoo commented Jun 22, 2018

Pre-Submission Checklist

  • Your pull request targets the 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 freeCodeCamp/freeCodeCamp#16358

Description

The original test was too rigid, and many users were forced to use one solution, usually map, to
complete the challenge. The test is changed here to allow for multiple solutions to the problem,
including the use of either single or double quotes when naming a class.

Here's a link to regexr with the new regex test and different solutions user's can submit: https://regexr.com/3rdvo

BREAKING CHANGE:
None

The original test was too rigid, and many users were forced to use one solution, usually map, to
complete the challenge. The test is changed here to allow for multiple solutions to the problem,
including the use of either single or double quotes when naming a class.

BREAKING CHANGE:
None
@scissorsneedfoodtoo scissorsneedfoodtoo changed the title fix(challenges): change test for template literals challenge fix(challenges): Change test for template literals challenge Jun 22, 2018
@scissorsneedfoodtoo scissorsneedfoodtoo changed the title fix(challenges): Change test for template literals challenge fix(challenges): change test for template literals challenge Jun 22, 2018
@beaucarnes
Copy link
Member

Looks good, thanks!

@beaucarnes beaucarnes merged commit 7ae1133 into freeCodeCamp:dev Jun 25, 2018
@scissorsneedfoodtoo
Copy link
Contributor Author

@beaucarnes, thanks for the review and merge!

@scissorsneedfoodtoo scissorsneedfoodtoo deleted the fix/create-strings-using-template-literals branch June 26, 2018 14:18
@numoonchld
Copy link

Test still doesn't pass for me when using arr[0], arr[1] and arr[2] as the templates within``

@scissorsneedfoodtoo
Copy link
Contributor Author

@numoonchld, yes, you're right. This fix was just merged yesterday, so it will take a little while for the live site to be updated to include it. We'll get on it soon!

@numoonchld
Copy link

thank you

raisedadead pushed a commit that referenced this pull request Jun 29, 2018
The original test was too rigid, and many users were forced to use one solution, usually map, to
complete the challenge. The test is changed here to allow for multiple solutions to the problem,
including the use of either single or double quotes when naming a class.

BREAKING CHANGE:
None
raisedadead pushed a commit that referenced this pull request Jun 29, 2018
The original test was too rigid, and many users were forced to use one solution, usually map, to
complete the challenge. The test is changed here to allow for multiple solutions to the problem,
including the use of either single or double quotes when naming a class.

BREAKING CHANGE:
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
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
# [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
@ghost
Copy link

ghost commented Jul 10, 2018

hi there it has been 13 days since update but i am having the same issues or rather omore. i will post the code here if that is ok.

----- start of code -----

// change code below this line
// tried a for loop and it seems like it did not accept it. and tried creating it manually indexing arr[0] [1] and [2] but that also throws errors. after a bit of googling i decided to try map and still getting problems

// attempt 1 - invalid regular expression flags
/*
const resultDisplayArray = [];
for (let i = 0; i < arr.length; i++) {
resultDisplayArray.push(<li class="text-warning">${arr[i]}</li>)
}
*/

// attempt 2 - invalid regular expression flags
/*
const resultDisplayArray = [
<li class="text-warning">${arr[0]}</li>,
<li class="text-warning">${arr[1]}</li>,
<li class="text-warning">${arr[2]}</li>
];
*/

//attempt 3 - invalid regular expression flags
/*
const resultDisplayArray = arr.map((a) => {
return <li class="text-warning">${a}</li>
});
*/
// attempt 4 - invalid regular expression flags
//const resultDisplayArray = arr.map(a => <li class="text-warning">${a}</li>);
// change code above this line

----- end of code -----

@thevenice
Copy link

thevenice commented Jul 12, 2018

my attempts
//1st
const resultDisplayArray =[];
arr.map((x) =>{return resultDisplayArray.push(<li class="text-warning">${x}</li>);});
//works on console not in fcc, error : " Invalid regular expression flags ".

//2nd
const resultDisplayArray = arr.map(x =><li class="text-warning">${x}</li> );
//same works on console not in fcc, error : " Invalid regular expression flags ".

@johnkennedy9147
Copy link
Contributor

@DecaDoesRust @thevenice see issue #135

@thevenice
Copy link

So youre saying that '/' this character mighy be the problem, then what should i use to display ? And pass this test.

@johnkennedy9147
Copy link
Contributor

@thevenice I'm saying the tests are wrong

@thevenice
Copy link

What should i do know

@johnkennedy9147
Copy link
Contributor

@thevenice it is not possible to pass the third test at the moment as the test is broken, however, looking at what you posted in your examples it would fail anyway as you are not using template literals. The lesson could do with improvement as it introduces multiple things at once and doesnt spend enough time making clear what a template literal is. I'll make some edits to clarify the lesson.

I think reading this MDN page MDN:Tempate Literals would help you a lot.

Follow #135 to see when the issues are resolved and you can come back to the challenge once it is fixed.

@thevenice
Copy link

Dude you really didn't know that back ticks didn't work on comments
Using back ticks: here.
See it will show you marked.

@thevenice
Copy link

If you have time just look this pictures both the code are working in chrome console but not in FCC.
https://twitter.com/Thevenicelive/status/1017285470571491328?s=19

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.

ES6: Create Strings using Template Literals - Test Fails - Doesn't detect template strings
5 participants