From f67b16e21f8a77606f8e54f497d58110f46a01ce Mon Sep 17 00:00:00 2001 From: SaintPeter Date: Tue, 10 Nov 2015 19:24:22 -0800 Subject: [PATCH] Add test case to Confirm the Ending, Clean up Solution --- challenges/basic-bonfires.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/challenges/basic-bonfires.json b/challenges/basic-bonfires.json index 77559eb676..c1327a5c84 100644 --- a/challenges/basic-bonfires.json +++ b/challenges/basic-bonfires.json @@ -328,13 +328,14 @@ "assert(end(\"Walking on water and developing software from a specification are easy if both are frozen\", \"specification\") === false, 'message: end(\"Walking on water and developing software from a specification are easy if both are frozen\", \"specification\") should return false.');", "assert(end(\"He has to give me a new name\", \"name\") === true, 'message: end(\"He has to give me a new name\", \"name\") should return true.');", "assert(end(\"He has to give me a new name\", \"me\") === true, 'message: end(\"He has to give me a new name\", \"me\") should return true.');", + "assert(end(\"He has to give me a new name\", \"na\") === false, 'message: end(\"He has to give me a new name\", \"na\") should return false.');", "assert(end(\"If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing\", \"mountain\") === false, 'message: end(\"If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing\", \"mountain\") should return false.');" ], "MDNlinks": [ "String.substr()" ], "solutions": [ - "function end(str, target) {\n // \"Never give up and good luck will find you.\"\n // -- Falcor\n return str.substring(str.length-target.length) === target;\n}\n\nend('Bastian', 'n');\n" + "function end(str, target) {\n return str.substring(str.length-target.length) === target;\n};\n" ], "type": "bonfire", "challengeType": 5,