Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@

[CmdletBinding()]
param (
[Parameter()][switch]$ShowTestErrors
[Parameter()][switch]$ShowTestErrors,
[Parameter()][string]$TestName
)

function Set-TestName{
Expand All @@ -28,7 +29,7 @@ function Set-TestName{
)

process{
$global:TestName = $TestName
$global:TestNameVar = $TestName
}
}

Expand All @@ -40,7 +41,7 @@ function Get-TestName{
)

process{
$global:TestName
$global:TestNameVar
}
}

Expand All @@ -52,7 +53,7 @@ function Clear-TestName{
param (
)

$global:TestName = $null
$global:TestNameVar = $null
}

function Import-RequiredModule{
Expand Down Expand Up @@ -137,8 +138,8 @@ Import-RequiredModule "TestingHelper" -AllowPrerelease
# Install and Load Module dependencies
Get-RequiredModule | Import-RequiredModule -AllowPrerelease

if($TestName){
Invoke-TestingHelper -TestName $TestName -ShowTestErrors:$ShowTestErrors
} else {
Invoke-TestingHelper -ShowTestErrors:$ShowTestErrors
}
# Resolve scoped tests
$TestName = [string]::IsNullOrWhiteSpace($TestName) ? $global:TestNameVar : $TestName

# Call TestingHelper to run the tests
Invoke-TestingHelper -TestName $TestName -ShowTestErrors:$ShowTestErrors
Loading