Merge pull request #1494 from PowerShell/vors/start-pspester

Simplify Start-PSPester
This commit is contained in:
Sergei Vorobev
2016-07-24 21:41:53 -07:00
committed by GitHub
+2 -4
View File
@@ -461,12 +461,10 @@ function Get-PSOutput {
function Start-PSPester {
[CmdletBinding()]param(
[string]$Flags = "-ExcludeTag 'Slow' -EnableExit -OutputFile pester-tests.xml -OutputFormat NUnitXml",
[string]$Tests = "*",
[ValidateScript({ Test-Path -PathType Container $_})]
[string]$Directory = "$PSScriptRoot/test/powershell"
[string]$Path = "$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) {
throw "$LASTEXITCODE Pester tests failed"
}