From 04c1ac18154179c7698f3963970967fe26c82337 Mon Sep 17 00:00:00 2001 From: Timo Date: Thu, 25 Jan 2018 00:35:32 +0100 Subject: [PATCH] test(challenges): Add missing tests to escaping quotes challenges (#16566) These tests were removed because there were issues with the head and tail being added to the code variable. Now that they've been removed, we can add the tests back in. --- .../basic-javascript.json | 4 ++-- 1 file changed, 2 insertions(+), 2 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 b6a1a995c00..d1fd6ed83ce 100644 --- a/challenges/02-javascript-algorithms-and-data-structures/basic-javascript.json +++ b/challenges/02-javascript-algorithms-and-data-structures/basic-javascript.json @@ -1053,7 +1053,7 @@ " }", "})();" ], - "solutions": [], + "solutions": ["var myStr = \"I am a \\\"double quoted\\\" string inside \\\"double quotes\\\".\";"], "tests": [ "assert(code.match(/\\\\\"/g).length === 4 && code.match(/[^\\\\]\"/g).length === 2, 'message: You should use two double quotes (") and four escaped double quotes (\").');", "assert(myStr === \"I am a \\\"double quoted\\\" string inside \\\"double quotes\\\".\", 'message: Variable myStr should contain the string: I am a \"double quoted\" string inside \"double quotes\".');" @@ -1101,7 +1101,7 @@ "tail": [ "(function() { return \"myStr = \" + myStr; })();" ], - "solutions": [], + "solutions": ["var myStr = 'Link';"], "tests": [ "assert(!/\\\\/g.test(code) && myStr.match('\\\\s*\\\\s*Link\\\\s*\\\\s*'), 'message: Remove all the backslashes (\\)');", "assert(code.match(/\"/g).length === 4 && code.match(/'/g).length === 2, 'message: You should have two single quotes ' and four double quotes "');"