fix: modified the test case such that the variable is a local scope o… (#34959)

* fix: modified the test case such that the variable is a local scope of the function

* fix: make test inclusive
This commit is contained in:
rupali317 2019-02-05 14:40:58 +08:00 committed by Ahmad Abdolsaheb
parent 4d26147726
commit 42bf229f59

View File

@ -26,7 +26,8 @@ tests:
- text: No global <code>myVar</code> variable
testString: assert(typeof myVar === 'undefined', 'No global <code>myVar</code> variable');
- text: Add a local <code>myVar</code> variable
testString: assert(/var\s+myVar/.test(code), 'Add a local <code>myVar</code> variable');
testString: assert(/function\s+myLocalScope\s*\(\s*\)\s*\{\s[\s\S]+\s*var\s*myVar\s*(\s*|=[\s\S]+)\s*;[\s\S]+}/.test(code), 'Add a local <code>myVar</code> variable');
```