From 0d1d35b49d88d83ebb7af2e357b08523660a8829 Mon Sep 17 00:00:00 2001 From: Mohammed <88824957+m7medVision@users.noreply.github.com> Date: Thu, 7 Mar 2024 00:30:48 +0400 Subject: [PATCH] Tests that need adjustments #33 add regex to strings/intro --- testcases/strings/intro.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/testcases/strings/intro.js b/testcases/strings/intro.js index e78fe0d..69f4f5d 100644 --- a/testcases/strings/intro.js +++ b/testcases/strings/intro.js @@ -29,14 +29,13 @@ function handleCodeRun(code) { } const output = handleCodeRun(code); -// const regex = /(let|const|var)\s+\w+\s*=\s*('|`|')\w+(`|'|")/; -// if (regex.test(code)) { -// console.log("You have declared a variable with a string value"); -// } +const regex = /(let|const|var)\s+\w+\s*=/; +if (regex.test(code)) { + if (output == "Ich Bin Yazan\nI am Yazan") { + isPass = true; + } else { + isPass = false; + msg = "The output is not correct"; + } +} -if (output == "Ich Bin Yazan\nI am Yazan") { - isPass = true; -} else { - isPass = false; - msg = "The output is not correct"; -} \ No newline at end of file