fix(learn): add whitespace check to else-if test (#39555)

pull/39559/head
Siddharth Pathak 2020-09-09 12:30:33 -07:00 committed by GitHub
parent 0f5832b562
commit 5418307936
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -37,7 +37,7 @@ tests:
- text: You should have at least two <code>if</code> statements
testString: assert(code.match(/if/g).length > 1);
- text: You should have closing and opening curly braces for each <code>if else</code> code block.
testString: assert(code.match(/if\s*\((.+)\)\s*\{[\s\S]+\}\s*else if\s*\((.+)\)\s*\{[\s\S]+\}\s*else\s*\{[\s\S]+\s*\}/));
testString: assert(code.match(/if\s*\((.+)\)\s*\{[\s\S]+\}\s*else\s+if\s*\((.+)\)\s*\{[\s\S]+\}\s*else\s*\{[\s\S]+\s*\}/));
- text: <code>testElseIf(0)</code> should return "Smaller than 5"
testString: assert(testElseIf(0) === "Smaller than 5");
- text: <code>testElseIf(5)</code> should return "Between 5 and 10"