File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414
1515[CmdletBinding ()]
1616param (
17- [Parameter ()][switch ]$ShowTestErrors
17+ [Parameter ()][switch ]$ShowTestErrors ,
18+ [Parameter ()][string ]$TestName
1819)
1920
2021function Set-TestName {
@@ -28,7 +29,7 @@ function Set-TestName{
2829 )
2930
3031 process {
31- $global :TestName = $TestName
32+ $global :TestNameVar = $TestName
3233 }
3334}
3435
@@ -40,7 +41,7 @@ function Get-TestName{
4041 )
4142
4243 process {
43- $global :TestName
44+ $global :TestNameVar
4445 }
4546}
4647
@@ -52,7 +53,7 @@ function Clear-TestName{
5253 param (
5354 )
5455
55- $global :TestName = $null
56+ $global :TestNameVar = $null
5657}
5758
5859function Import-RequiredModule {
@@ -137,8 +138,8 @@ Import-RequiredModule "TestingHelper" -AllowPrerelease
137138# Install and Load Module dependencies
138139Get-RequiredModule | Import-RequiredModule - AllowPrerelease
139140
140- if ( $TestName ){
141- Invoke-TestingHelper - TestName $TestName - ShowTestErrors: $ShowTestErrors
142- } else {
143- Invoke-TestingHelper - ShowTestErrors: $ShowTestErrors
144- }
141+ # Resolve scoped tests
142+ $TestName = [ string ]::IsNullOrWhiteSpace( $ TestName) ? $ global :TestNameVar : $TestName
143+
144+ # Call TestingHelper to run the tests
145+ Invoke-TestingHelper - TestName $TestName - ShowTestErrors: $ShowTestErrors
You can’t perform that action at this time.
0 commit comments