Fix/tests whitespace strictness (#36706)
* fix(tests): make less strict about white space
This commit is contained in:
committed by
Oliver Eyton-Williams
parent
46d67deb46
commit
428ab97650
@ -25,7 +25,7 @@ Log the message <code>'Now I know React and Redux!'</code> to the console.
|
||||
```yml
|
||||
tests:
|
||||
- text: The message <code>Now I know React and Redux!</code> 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')));
|
||||
|
||||
```
|
||||
|
||||
|
@ -49,7 +49,7 @@ tests:
|
||||
- text: Your code should have an <code>onload</code> 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 <code>JSON.parse</code> method to parse the <code>responseText</code>.
|
||||
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 <code>message</code> 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));
|
||||
|
||||
|
Reference in New Issue
Block a user