fix(challenges): add test to check user is using \W in Regex

Add test to make sure user is using \W and not ^\w
This commit is contained in:
Rob Anthony 2018-08-08 16:15:09 +01:00 committed by Kristofer Koishigawa
parent 16d52cbcdf
commit 296cf44f57

View File

@ -944,6 +944,10 @@
"text": "Your regex should find 6 non-alphanumeric characters in <code>\"The five boxing wizards jump quickly.\"</code>.",
"testString": "assert(\"The five boxing wizards jump quickly.\".match(nonAlphabetRegex).length == 6, 'Your regex should find 6 non-alphanumeric characters in <code>\"The five boxing wizards jump quickly.\"</code>.');"
},
{
"text": "Your regex should use the shorthand character.",
"testString":"assert(/\\\\W/.test(nonAlphabetRegex.source), 'Your regex should use the shorthand character to match characters which are non-alphanumeric.');"
},
{
"text": "Your regex should find 8 non-alphanumeric characters in <code>\"Pack my box with five dozen liquor jugs.\"</code>",
"testString": "assert(\"Pack my box with five dozen liquor jugs.\".match(nonAlphabetRegex).length == 8, 'Your regex should find 8 non-alphanumeric characters in <code>\"Pack my box with five dozen liquor jugs.\"</code>');"
@ -1718,4 +1722,4 @@
}
}
]
}
}