diff --git a/challenges/02-javascript-algorithms-and-data-structures/es6.json b/challenges/02-javascript-algorithms-and-data-structures/es6.json index 4f92d7361..693745ac6 100644 --- a/challenges/02-javascript-algorithms-and-data-structures/es6.json +++ b/challenges/02-javascript-algorithms-and-data-structures/es6.json @@ -1120,15 +1120,20 @@ ], "tests": [ { - "text": - "setGear is a function and changes the gear variable.", + "text": "Traditional function expression was not used.", "testString": - "assert(() => { bicycle.setGear(48); return bicycle.gear === 48 }, 'setGear is a function and changes the gear variable.');" + "assert(!getUserInput('index').match(/function/),'Traditional function expression was not used.');" }, { - "text": "Declarative function was used.", + "text": "setGear is a declarative function.", + "testString": + "assert(typeof bicycle.setGear === 'function' && getUserInput('index').match(/setGear\\s*\\(.+\\)\\s*\\{/), 'setGear is a declarative function.');" + }, + { + "text": + "bicycle.setGear(48) changes the gear value to 48.", "testString": - "getUserInput => assert(!getUserInput('index').match(/:\\s*function\\s*\\(\\)/g), 'Declarative function was used.');" + "assert((new bicycle.setGear(48)).gear === 48, 'bicycle.setGear(48) changes the gear value to 48.');" } ], "releasedOn": "Feb 17, 2017",