From 5ab3bf6c9d8364df8cfa7780ee83d0ede1aa9b2f Mon Sep 17 00:00:00 2001 From: Dylan Date: Fri, 9 Dec 2016 22:05:36 -0600 Subject: [PATCH] :change test to ensure use of / --- .../basic-javascript.json | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/challenges/02-javascript-algorithms-and-data-structures/basic-javascript.json b/challenges/02-javascript-algorithms-and-data-structures/basic-javascript.json index 726a3506d8..406b811743 100644 --- a/challenges/02-javascript-algorithms-and-data-structures/basic-javascript.json +++ b/challenges/02-javascript-algorithms-and-data-structures/basic-javascript.json @@ -677,19 +677,18 @@ "Change the 0.0 so that quotient will equal to 2.2." ], "challengeSeed": [ - "var quotient = 0.0 / 2.0;", + "var quotient = 0.0 / 2.0; // Fix this line", "", "" ], "tail": [ "(function(y){return 'quotient = '+y;})(quotient);" ], - "solutions": [ - "var quotient = 4.4 / 2.0;" - ], + "solutions": [], "tests": [ - "assert(quotient === 2.2, 'message: The variable quotient should equal 2.2.');", - "assert(/\\//.test(code), 'message: You should use the / operator');" + "assert(quotient === 2.2, 'message: The variable quotient should equal 2.2');", + "assert(/4\\.40*\\s*\\/\\s*2\\.*0*/.test(code), 'message: You should use the / operator to divide 4.4 by 2');", + "assert(code.match(/quotient/g).length === 3, 'message: The quotient variable should only be assigned once');" ], "type": "waypoint", "challengeType": 1,