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

Commit ded4705

Browse files
Nirajn2311scissorsneedfoodtoo
authored andcommitted
fix(challenges): fixed tests to check for pre operators
Increment and decrement a number challenge will now check for post-increment ISSUES CLOSED: #199
1 parent 8f17adf commit ded4705

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@
661661
{
662662
"text": "<code>myVar = myVar + 1;</code> should be changed",
663663
"testString":
664-
"assert(/var\\s*myVar\\s*=\\s*87;\\s*\\/*.*\\s*myVar\\+\\+;/.test(code), '<code>myVar = myVar + 1;</code> should be changed');"
664+
"assert(/var\\s*myVar\\s*=\\s*87;\\s*\\/*.*\\s*([+]{2}\\s*myVar|myVar\\s*[+]{2});/.test(code), '<code>myVar = myVar + 1;</code> should be changed');"
665665
},
666666
{
667667
"text": "Use the <code>++</code> operator",
@@ -729,7 +729,7 @@
729729
{
730730
"text": "<code>myVar = myVar - 1;</code> should be changed",
731731
"testString":
732-
"assert(/var\\s*myVar\\s*=\\s*11;\\s*\\/*.*\\s*myVar--;/.test(code), '<code>myVar = myVar - 1;</code> should be changed');"
732+
"assert(/var\\s*myVar\\s*=\\s*11;\\s*\\/*.*\\s*([-]{2}\\s*myVar|myVar\\s*[-]{2});/.test(code), '<code>myVar = myVar - 1;</code> should be changed');"
733733
},
734734
{
735735
"text": "Use the <code>--</code> operator on <code>myVar</code>",

0 commit comments

Comments
 (0)