From 0a7932ea1d13f0ef341f8bcc064c107f759157ec Mon Sep 17 00:00:00 2001
From: lasjorg <28780271+lasjorg@users.noreply.github.com>
Date: Sun, 24 Feb 2019 15:54:37 +0100
Subject: [PATCH] fix(challenge): update test to support arrow function
(#35268)
* fix(challenge): update test to support arrow function
* fix(challenge): update solution
* fix(challenge): update solution fully
* fix: corrected unrelated issue
---
...avascript-xmlhttprequest-method.english.md | 52 ++++++++++++++++++-
1 file changed, 50 insertions(+), 2 deletions(-)
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 2deb30361d..6d7f42a309 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
@@ -36,7 +36,7 @@ tests:
- text: Your code should use the send
method to send the request.
testString: assert(code.match(/\.send\(\s*\)/g), 'Your code should use the send
method to send the request.');
- text: Your code should have an onload
event handler set to a function.
- testString: assert(code.match(/\.onload\s*=\s*function\s*?\(\s*?\)\s*?{/g), '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), 'Your code should have an onload
event handler set to a function.');
- text: Your code should use the JSON.parse
method to parse the responseText
.
testString: assert(code.match(/JSON\s*\.parse\(.*\.responseText\)/g), 'Your code should use the JSON.parse
method to parse the responseText
.');
- text: Your code should get the element with class message
and change its inner HTML to the string of JSON data.
@@ -89,7 +89,7 @@ tests:
}
@@ -110,5 +110,53 @@ tests: ```js // solution required + + +
+ +
```