fix(challenges): fix broken tests - es6_declarative_function

This commit is contained in:
Pushpender Maan
2018-07-16 07:03:41 +05:30
committed by Kristofer Koishigawa
parent f0b7ea9e56
commit 667dba93b4

View File

@ -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":
"getUserInput => assert(!getUserInput('index').match(/:\\s*function\\s*\\(\\)/g), 'Declarative function was used.');"
"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":
"assert((new bicycle.setGear(48)).gear === 48, '<code>bicycle.setGear(48)</code> changes the <code>gear</code> value to 48.');"
}
],
"releasedOn": "Feb 17, 2017",