fix: make tests more robust (#37830)

This commit is contained in:
Randell Dawson
2019-12-02 15:42:32 -08:00
committed by Manish Giri
parent a68e3ef39d
commit dd2fb28ee0

View File

@ -36,8 +36,8 @@ tests:
testString: assert(total === 20);
- text: You should use a <code>for</code> loop to iterate through <code>myArr</code>.
testString: assert(code.match(/for\s*\(/g).length > 1 && code.match(/myArr\s*\[/));
- text: You should not set <code>total</code> to 20 directly.
testString: assert(!code.match(/total[\s\+\-]*=\s*(0(?!\s*[;,]?$)|[1-9])/gm));
- text: You should not attempt to directly assign the value 20 to <code>total</code>.
testString: assert(!code.replace(/\s/g, '').match(/total[=+-]0*[1-9]+/gm));
```
</section>