From fff0dd5a66e7909e8799326b10f0e8b1f6de4269 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/seed/challenges/02-javascript-algorithms-and-data-structures/basic-javascript.json b/seed/challenges/02-javascript-algorithms-and-data-structures/basic-javascript.json index b6a1a995c0..d1fd6ed83c 100644 --- a/seed/challenges/02-javascript-algorithms-and-data-structures/basic-javascript.json +++ b/seed/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 "');"