Skip to content

Commit

Permalink
fix(challenges): fixed tests to check for pre operators
Browse files Browse the repository at this point in the history
Increment and decrement a number challenge
will now check for post-increment

ISSUES CLOSED: freeCodeCamp#199
  • Loading branch information
Nirajn2311 authored and scissorsneedfoodtoo committed Aug 18, 2018
1 parent 8f17adf commit ded4705
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@
{
"text": "<code>myVar = myVar + 1;</code> should be changed",
"testString":
"assert(/var\\s*myVar\\s*=\\s*87;\\s*\\/*.*\\s*myVar\\+\\+;/.test(code), '<code>myVar = myVar + 1;</code> should be changed');"
"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');"
},
{
"text": "Use the <code>++</code> operator",
Expand Down Expand Up @@ -729,7 +729,7 @@
{
"text": "<code>myVar = myVar - 1;</code> should be changed",
"testString":
"assert(/var\\s*myVar\\s*=\\s*11;\\s*\\/*.*\\s*myVar--;/.test(code), '<code>myVar = myVar - 1;</code> should be changed');"
"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');"
},
{
"text": "Use the <code>--</code> operator on <code>myVar</code>",
Expand Down

0 comments on commit ded4705

Please sign in to comment.