Fix(challenge): Escaping Quote

Changes the number of matches from the regex to accomodate
the additions added through babel and head/tail.
Also changes tail to use console.log to print out info
pull/10518/head
Berkeley Martinez 2016-09-08 14:54:54 -07:00
parent eba29a7cd5
commit 31e904f4ff
1 changed files with 5 additions and 7 deletions

View File

@ -1074,24 +1074,22 @@
],
"releasedOn": "January 1, 2016",
"challengeSeed": [
"var myStr; // Change this line",
"var myStr = \"\"; // Change this line",
"",
""
],
"tail": [
"(function(){",
" if(typeof myStr === 'string') {",
" return \"myStr = \" + myStr;",
" console.log(\"myStr = \\\"\" + myStr + \"\\\"\");",
" } else {",
" return \"myStr is undefined\";",
" console.log(\"myStr is undefined\");",
" }",
"})();"
],
"solutions": [
"var myStr = \"I am a \\\"double quoted\\\" string inside \\\"double quotes\\\".\";"
],
"solutions": [],
"tests": [
"assert(code.match(/\\\\\"/g).length === 4 && code.match(/[^\\\\]\"/g).length === 2, 'message: You should use two double quotes (<code>&quot;</code>) and four escaped double quotes (<code>&#92;&quot;</code>).');",
"assert(code.match(/\\\\\"/g).length === 6 && code.match(/[^\\\\]\"/g).length === 10, 'message: You should use two double quotes (<code>&quot;</code>) and four escaped double quotes (<code>&#92;&quot;</code>).');",
"assert(myStr === \"I am a \\\"double quoted\\\" string inside \\\"double quotes\\\".\", 'message: Variable myStr should contain the string: <code>I am a \"double quoted\" string inside \"double quotes\".</code>');"
],
"type": "waypoint",