Skip to content

Commit

Permalink
Simplify Start-PSPester
Browse files Browse the repository at this point in the history
Pester already handles folder vs file.
There is no need to have custom logic in Start-PSPester.
  • Loading branch information
Sergei Vorobev committed Jul 23, 2016
1 parent 28a7ca2 commit ea3e7db
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions build.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down

0 comments on commit ea3e7db

Please sign in to comment.