Merge pull request #10353 from dhcodes/fix/contradictory-goals-quoting-strings-challenge

combine backslash tests for quoting strings challenge
This commit is contained in:
Logan Tegman
2016-10-16 13:45:24 -07:00
committed by GitHub

View File

@ -1135,9 +1135,8 @@
"var myStr = '<a href=\"http://www.example.com\" target=\"_blank\">Link</a>';"
],
"tests": [
"assert(!/\\\\/g.test(code), '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>&#39;</code> and four double quotes <code>&quot;</code>');",
"assert(myStr === '<a href=\"http://www.example.com\" target=\"_blank\">Link</a>', 'message: Only remove the backslashes <code>\\</code> used to escape quotes.');"
"assert(!/\\\\/g.test(code) && myStr === '<a href=\"http://www.example.com\" target=\"_blank\">Link</a>', '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>&#39;</code> and four double quotes <code>&quot;</code>');"
],
"type": "waypoint",
"challengeType": 1,