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

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
This commit is contained in:
Kristofer Koishigawa
2018-06-26 02:20:21 +09:00
committed by mrugesh mohapatra
parent 6bb62c7c2c
commit 4b1c5ebc7a

View File

@ -1015,7 +1015,7 @@
{
"text": "Template strings were used",
"testString":
"getUserInput => assert(getUserInput('index').match(/\\`<li class=\"text-warning\">\\$\\{\\w+\\}<\\/li>\\`/g), 'Template strings were used');"
"getUserInput => assert(getUserInput('index').match(/\\`<li \\s*class\\s*=\\s*(\"\\s*text-warning\\s*\"|\\'\\s*text-warning\\s*\\')\\s*>\\s*\\$\\s*\\{(\\s*\\w+\\s*|\\s*\\w+\\s*\\[\\s*[\\w]+\\s*\\]\\s*)\\}\\s*<\\s*/li\\s*>\\`/g), 'Template strings were used');"
}
],
"releasedOn": "Feb 17, 2017",