From a050de56bb89e59465ffd319e1ccdce4b413083b Mon Sep 17 00:00:00 2001 From: Joshua Pelealu <45566099+JoshuaPelealu@users.noreply.github.com> Date: Tue, 1 Sep 2020 19:48:32 -0400 Subject: [PATCH] Fix: Running Test with a comment fails test on Understand The immediately invoked function expression iife (#39347) * Update Regex to test if it's an IIFE instead of checking for a parenthases at the end. * Second Test will now pass the test * Escape One Parenthese * Update Regex to be more structured Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com> * Missing regex ending literal Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com> --- ...-the-immediately-invoked-function-expression-iife.english.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/understand-the-immediately-invoked-function-expression-iife.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/understand-the-immediately-invoked-function-expression-iife.english.md index d3d7b4a7e9..c23dbe0de9 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/understand-the-immediately-invoked-function-expression-iife.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/object-oriented-programming/understand-the-immediately-invoked-function-expression-iife.english.md @@ -33,7 +33,7 @@ tests: - text: The function should be anonymous. testString: assert(/\((function|\(\))(=>|\(\)){?/.test(code.replace(/\s/g, ""))); - text: Your function should have parentheses at the end of the expression to call it immediately. - testString: assert(/}?\)\(\)$|}\(\)\)$/.test(code.replace(/[\s;]/g, ""))); + testString: assert(/\(.*(\)\(|\}\(\))\)/.test(code.replace(/[\s;]/g, ""))); ```