From 98d75156f49781ae2525540cc3b041e92f60e912 Mon Sep 17 00:00:00 2001 From: Milo Hartsoe Date: Sat, 27 May 2017 15:24:52 -0400 Subject: [PATCH] Add tests to es6 challenge Write Higher Order Arrow Functions. Doesn't have es6 syntax tests. Comments out function and arrow tests that didn't work and fixes formatting issues. --- .../es6.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/challenges/02-javascript-algorithms-and-data-structures/es6.json b/challenges/02-javascript-algorithms-and-data-structures/es6.json index 861aea3153..a845dcf468 100644 --- a/challenges/02-javascript-algorithms-and-data-structures/es6.json +++ b/challenges/02-javascript-algorithms-and-data-structures/es6.json @@ -265,14 +265,14 @@ "console.log(squaredIntegers);" ], "tests": [ - "// Test user did replace var keyword", - "// Test squaredIntegers is const", - "// Test squaredIntegers is an array", - "// Test squaredIntegers is [16, 1764, 36]", - "// Test function keyword was not used", - "// Test arrow => was used", - "// Test loop was not used", - "// Test map and filter were used" + "// Test user did replace var keyword", + "// Test squaredIntegers is const", + "assert(Array.isArray(squaredIntegers), 'message: squaredIntegers should be an array');", + "assert(squaredIntegers[0] === 16 && squaredIntegers[1] === 1764 && squaredIntegers[2] === 36, 'message: squaredIntegers should be [16, 1764, 36]');", + "// Test function keyword was not used", + "// Test arrow => was used", + "assert(!code.match(/(for)|(while)/g), 'message: loop should not be used');", + "assert(code.match(/map/g) && code.match(/filter/g), 'message: map and filter should be used');" ], "type": "waypoint", "releasedOn": "Feb 17, 2017",