fix(challenges): fix broken tests - es6_declarative_function
This commit is contained in:
committed by
Kristofer Koishigawa
parent
f0b7ea9e56
commit
667dba93b4
@ -1120,15 +1120,20 @@
|
|||||||
],
|
],
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
||||||
"text":
|
"text": "Traditional function expression was not used.",
|
||||||
"<code>setGear</code> is a function and changes the <code>gear</code> variable.",
|
|
||||||
"testString":
|
"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":
|
"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",
|
"releasedOn": "Feb 17, 2017",
|
||||||
|
Reference in New Issue
Block a user