fix(curriculum): "Get JSON with the JavaScript fetch method" test too tpecific (#41766)

This commit is contained in:
Jonathan
2021-04-08 08:20:29 +01:00
committed by GitHub
parent d1c800879c
commit fa52f4cafe

View File

@ -57,15 +57,15 @@ assert(
Your code should use `then` to handle the data converted to JSON by the other `then`. Your code should use `then` to handle the data converted to JSON by the other `then`.
```js ```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. Your code should get the element with id `message` and change its inner HTML to the string of JSON data.
```js ```js
assert( assert(
code.match( __helpers.removeWhiteSpace(code).match(
/document\s*\.getElementById\s*\(\s*('|")message\1\s*\)\s*\.innerHTML\s*=\s*JSON\s*\.\s*stringify\s*\(\s*data\s*\)/g /document\.getElementById\(('|")message\1\)\.innerHTML=JSON\.stringify\(?\w+\)/g
) )
); );
``` ```