Skip to content
This repository was archived by the owner on Sep 25, 2019. It is now read-only.

Commit cb21e59

Browse files
Strahinja Mitrovicscissorsneedfoodtoo
authored andcommitted
fix(challenges): fix #17155
i've added a test for if else statements curly braces to ensure that every condition has to have both opening and closing curly braces. I've also made changes that were by scissorsneedfood. ISSUES CLOSED: #17155
1 parent 6058da3 commit cb21e59

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

challenges/02-javascript-algorithms-and-data-structures/basic-javascript.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5066,6 +5066,12 @@
50665066
"testString":
50675067
"assert(code.match(/if/g).length > 1, 'You should have at least two <code>if</code> statements');"
50685068
},
5069+
{
5070+
"text":
5071+
"You should have closing and opening curly braces for each condition",
5072+
"testString":
5073+
"assert(code.match(/if\\s*\\((.+)\\)\\s*\\{[\\s\\S]+\\}\\s*else if\\s*\\((.+)\\)\\s*\\{[\\s\\S]+\\}\\s*else\\s*\\{[\\s\\S]+\\s*\\}/), 'You should have closing and opening curly braces for each condition in your if else statement');"
5074+
},
50695075
{
50705076
"text": "<code>testElseIf(0)</code> should return \"Smaller than 5\"",
50715077
"testString":

0 commit comments

Comments
 (0)