test(challenges): Add missing tests to escaping quotes challenges (#16566)
These tests were removed because there were issues with the head and tail being added to the code variable. Now that they've been removed, we can add the tests back in.
This commit is contained in:
@ -1053,7 +1053,7 @@
|
||||
" }",
|
||||
"})();"
|
||||
],
|
||||
"solutions": [],
|
||||
"solutions": ["var myStr = \"I am a \\\"double quoted\\\" string inside \\\"double quotes\\\".\";"],
|
||||
"tests": [
|
||||
"assert(code.match(/\\\\\"/g).length === 4 && code.match(/[^\\\\]\"/g).length === 2, 'message: You should use two double quotes (<code>"</code>) and four escaped double quotes (<code>\"</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>');"
|
||||
@ -1101,7 +1101,7 @@
|
||||
"tail": [
|
||||
"(function() { return \"myStr = \" + myStr; })();"
|
||||
],
|
||||
"solutions": [],
|
||||
"solutions": ["var myStr = '<a href=\"http://www.example.com\" target=\"_blank\">Link</a>';"],
|
||||
"tests": [
|
||||
"assert(!/\\\\/g.test(code) && myStr.match('\\\\s*<a href\\\\s*=\\\\s*\"http://www.example.com\"\\\\s*target\\\\s*=\\\\s*\"_blank\">\\\\s*Link\\\\s*</a>\\\\s*'), 'message: Remove all the <code>backslashes</code> (<code>\\</code>)');",
|
||||
"assert(code.match(/\"/g).length === 4 && code.match(/'/g).length === 2, 'message: You should have two single quotes <code>'</code> and four double quotes <code>"</code>');"
|
||||
|
Reference in New Issue
Block a user