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:
		
				
					committed by
					
						
						Ahmad Abdolsaheb
					
				
			
			
				
	
			
			
			
						parent
						
							4d26147726
						
					
				
				
					commit
					42bf229f59
				
			@@ -26,7 +26,8 @@ tests:
 | 
				
			|||||||
  - text: No global <code>myVar</code> variable
 | 
					  - text: No global <code>myVar</code> variable
 | 
				
			||||||
    testString: assert(typeof myVar === 'undefined', '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
 | 
					  - 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');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user