From 428ab9765031da1fa3a3f19f7bd2c0755678e2cd Mon Sep 17 00:00:00 2001 From: Tom <20648924+moT01@users.noreply.github.com> Date: Wed, 28 Aug 2019 03:53:17 -0500 Subject: [PATCH] Fix/tests whitespace strictness (#36706) * fix(tests): make less strict about white space --- .../react-and-redux/moving-forward-from-here.english.md | 2 +- ...et-json-with-the-javascript-xmlhttprequest-method.english.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/curriculum/challenges/english/03-front-end-libraries/react-and-redux/moving-forward-from-here.english.md b/curriculum/challenges/english/03-front-end-libraries/react-and-redux/moving-forward-from-here.english.md index f9b914cfcb..81ab835b4a 100644 --- a/curriculum/challenges/english/03-front-end-libraries/react-and-redux/moving-forward-from-here.english.md +++ b/curriculum/challenges/english/03-front-end-libraries/react-and-redux/moving-forward-from-here.english.md @@ -25,7 +25,7 @@ Log the message 'Now I know React and Redux!' to the console. ```yml tests: - text: The message Now I know React and Redux! should be logged to the console. - testString: getUserInput => assert(/console.log\(("|')Now I know React and Redux!\1\)/.test(getUserInput('index'))); + testString: getUserInput => assert(/console\s*\.\s*log\s*\(\s*('|"|`)Now I know React and Redux!\1\s*\)/.test(getUserInput('index'))); ``` diff --git a/curriculum/challenges/english/04-data-visualization/json-apis-and-ajax/get-json-with-the-javascript-xmlhttprequest-method.english.md b/curriculum/challenges/english/04-data-visualization/json-apis-and-ajax/get-json-with-the-javascript-xmlhttprequest-method.english.md index b670fb431c..69828212e6 100644 --- a/curriculum/challenges/english/04-data-visualization/json-apis-and-ajax/get-json-with-the-javascript-xmlhttprequest-method.english.md +++ b/curriculum/challenges/english/04-data-visualization/json-apis-and-ajax/get-json-with-the-javascript-xmlhttprequest-method.english.md @@ -49,7 +49,7 @@ tests: - text: Your code should have an onload event handler set to a function. testString: assert(code.match(/\.onload\s*=\s*(function|\(\s*?\))\s*?(\(\s*?\)|\=\>)\s*?{/g)); - text: Your code should use the JSON.parse method to parse the responseText. - testString: assert(code.match(/JSON\s*\.parse\(.*\.responseText\)/g)); + testString: assert(code.match(/JSON\s*\.parse\(\s*.*\.responseText\s*\)/g)); - text: Your code should get the element with class message and change its inner HTML to the string of JSON data. testString: assert(code.match(/document\s*\.getElementsByClassName\(\s*?('|")message\1\s*?\)\[0\]\s*\.innerHTML\s*?=\s*?JSON\.stringify\(.+?\)/g));