From 42bf229f59de7025d74021f9f2a3b9e17f404b69 Mon Sep 17 00:00:00 2001 From: rupali317 Date: Tue, 5 Feb 2019 14:40:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20modified=20the=20test=20case=20such=20th?= =?UTF-8?q?at=20the=20variable=20is=20a=20local=20scope=20o=E2=80=A6=20(#3?= =?UTF-8?q?4959)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: modified the test case such that the variable is a local scope of the function * fix: make test inclusive --- .../basic-javascript/local-scope-and-functions.english.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/local-scope-and-functions.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/local-scope-and-functions.english.md index f52135d331..155b114286 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/local-scope-and-functions.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/local-scope-and-functions.english.md @@ -26,7 +26,8 @@ tests: - text: No global myVar variable testString: assert(typeof myVar === 'undefined', 'No global myVar variable'); - text: Add a local myVar variable - testString: assert(/var\s+myVar/.test(code), 'Add a local myVar variable'); + testString: assert(/function\s+myLocalScope\s*\(\s*\)\s*\{\s[\s\S]+\s*var\s*myVar\s*(\s*|=[\s\S]+)\s*;[\s\S]+}/.test(code), 'Add a local myVar variable'); + ```