From fa52f4cafe958644b0bd0f348a2e9b529fc3b432 Mon Sep 17 00:00:00 2001 From: Jonathan <80848313+jonathankerr@users.noreply.github.com> Date: Thu, 8 Apr 2021 08:20:29 +0100 Subject: [PATCH] fix(curriculum): "Get JSON with the JavaScript fetch method" test too tpecific (#41766) --- .../get-json-with-the-javascript-fetch-method.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/curriculum/challenges/english/04-data-visualization/json-apis-and-ajax/get-json-with-the-javascript-fetch-method.md b/curriculum/challenges/english/04-data-visualization/json-apis-and-ajax/get-json-with-the-javascript-fetch-method.md index c0f3007978..f1a4c26f29 100644 --- a/curriculum/challenges/english/04-data-visualization/json-apis-and-ajax/get-json-with-the-javascript-fetch-method.md +++ b/curriculum/challenges/english/04-data-visualization/json-apis-and-ajax/get-json-with-the-javascript-fetch-method.md @@ -57,15 +57,15 @@ assert( Your code should use `then` to handle the data converted to JSON by the other `then`. ```js -assert(code.match(/\.then\s*\(\s*(data|\(\s*data\s*\))\s*=>\s*{[^}]*}\s*\)/g)); +assert(__helpers.removeWhiteSpace(code).match(/\.then\(\(?\w+\)?=>{[^}]*}\)/g)); ``` Your code should get the element with id `message` and change its inner HTML to the string of JSON data. ```js assert( - code.match( - /document\s*\.getElementById\s*\(\s*('|")message\1\s*\)\s*\.innerHTML\s*=\s*JSON\s*\.\s*stringify\s*\(\s*data\s*\)/g + __helpers.removeWhiteSpace(code).match( + /document\.getElementById\(('|")message\1\)\.innerHTML=JSON\.stringify\(?\w+\)/g ) ); ```