From 5aaa03c67e888b989b1aea5d3ac7d5a8c3f2c729 Mon Sep 17 00:00:00 2001 From: Ahmad Abdolsaheb Date: Fri, 23 Mar 2018 20:41:44 +0300 Subject: [PATCH] fix(seed): Chall seed and test are modified to allow better t (#16928) es6.json seed file changed Closes #16356 --- .../es6.json | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/seed/challenges/02-javascript-algorithms-and-data-structures/es6.json b/seed/challenges/02-javascript-algorithms-and-data-structures/es6.json index 7e65a4f252..805ac97070 100644 --- a/seed/challenges/02-javascript-algorithms-and-data-structures/es6.json +++ b/seed/challenges/02-javascript-algorithms-and-data-structures/es6.json @@ -883,7 +883,7 @@ "description": [ "Suppose you have a file that you wish to import all of its contents into the current file. This can be done with the import * syntax.", "Here's an example where the contents of a file named \"math_functions\" are imported into a file in the same directory:", - "
import * as myMathModule from \"math_functions\"
myMathModule.add(2,3);
myMathModule.subtract(5,3);
", + "
import * as myMathModule from \"math_functions\";
myMathModule.add(2,3);
myMathModule.subtract(5,3);
", "And breaking down that code:", "
import * as object_with_name_of_your_choice from \"file_path_goes_here\"
object_with_name_of_your_choice.imported_function
", "You may use any name following the import * as portion of the statement. In order to utilize this method, it requires an object that receives the imported values. From here, you will use the dot notation to call your imported values.", @@ -899,12 +899,10 @@ "}}};" ], "challengeSeed": [ - "\"use strict\";", - "myStringModule.capitalize(\"foo\");", - "myStringModule.lowercase(\"Foo\");" + "\"use strict\";" ], "tests": [ - "getUserInput => assert(getUserInput('index').match(/import\\s+\\*\\s+as\\s+myStringModule\\s+from\\s+\"capitalize_strings\"/g), 'message: Properly uses import * as syntax.');" + "assert(code.match(/import\\s+\\*\\s+as\\s+[a-zA-Z0-9_$]+\\s+from\\s*\"\\s*capitalize_strings\\s*\"\\s*;/gi), 'message: Properly uses import * as syntax.');" ], "type": "waypoint", "releasedOn": "Feb 17, 2017", @@ -969,4 +967,4 @@ "translations": {} } ] -} \ No newline at end of file +}