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

Commit

Permalink
fix(challenges): fix broken tests - es6_declarative_function
Browse files Browse the repository at this point in the history
  • Loading branch information
mpmaan authored and scissorsneedfoodtoo committed Jul 16, 2018
1 parent f0b7ea9 commit 667dba9
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions challenges/02-javascript-algorithms-and-data-structures/es6.json
Original file line number Diff line number Diff line change
Expand Up @@ -1120,15 +1120,20 @@
],
"tests": [
{
"text":
"<code>setGear</code> is a function and changes the <code>gear</code> variable.",
"text": "Traditional function expression was not used.",
"testString":
"assert(() => { bicycle.setGear(48); return bicycle.gear === 48 }, '<code>setGear</code> is a function and changes the <code>gear</code> variable.');"
"assert(!getUserInput('index').match(/function/),'Traditional <code>function</code> expression was not used.');"
},
{
"text": "Declarative function was used.",
"text": "<code>setGear</code> is a declarative function.",
"testString":
"assert(typeof bicycle.setGear === 'function' && getUserInput('index').match(/setGear\\s*\\(.+\\)\\s*\\{/), '<code>setGear</code> is a declarative function.');"
},
{
"text":
"<code>bicycle.setGear(48)</code> changes the <code>gear</code> value to 48.",
"testString":
"getUserInput => assert(!getUserInput('index').match(/:\\s*function\\s*\\(\\)/g), 'Declarative function was used.');"
"assert((new bicycle.setGear(48)).gear === 48, '<code>bicycle.setGear(48)</code> changes the <code>gear</code> value to 48.');"
}
],
"releasedOn": "Feb 17, 2017",
Expand Down

0 comments on commit 667dba9

Please sign in to comment.