mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 04:36:39 +00:00
Simplify Start-PSPester
Pester already handles folder vs file. There is no need to have custom logic in Start-PSPester.
This commit is contained in:
1 parent
28a7ca2dc0
commit
ea3e7db598
1 file changed
+2
-4
+2
-4
@@ -461,12 +461,10 @@ function Get-PSOutput {
|
|||||||
function Start-PSPester {
|
function Start-PSPester {
|
||||||
[CmdletBinding()]param(
|
[CmdletBinding()]param(
|
||||||
[string]$Flags = "-ExcludeTag 'Slow' -EnableExit -OutputFile pester-tests.xml -OutputFormat NUnitXml",
|
[string]$Flags = "-ExcludeTag 'Slow' -EnableExit -OutputFile pester-tests.xml -OutputFormat NUnitXml",
|
||||||
[string]$Tests = "*",
|
[string]$Path = "$PSScriptRoot/test/powershell"
|
||||||
[ValidateScript({ Test-Path -PathType Container $_})]
|
|
||||||
[string]$Directory = "$PSScriptRoot/test/powershell"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
& (Get-PSOutput) -noprofile -c "Import-Module '$PSScriptRoot/src/Modules/Shared/Pester'; Invoke-Pester $Flags $Directory/$Tests"
|
& (Get-PSOutput) -noprofile -c "Import-Module '$PSScriptRoot/src/Modules/Shared/Pester'; Invoke-Pester $Flags $Path"
|
||||||
if ($LASTEXITCODE -ne 0) {
|
if ($LASTEXITCODE -ne 0) {
|
||||||
throw "$LASTEXITCODE Pester tests failed"
|
throw "$LASTEXITCODE Pester tests failed"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user