From ea3e7db598bb8887c5d3809532c8282b96053612 Mon Sep 17 00:00:00 2001 From: Sergei Vorobev Date: Fri, 22 Jul 2016 17:46:12 -0700 Subject: [PATCH] Simplify Start-PSPester Pester already handles folder vs file. There is no need to have custom logic in Start-PSPester. --- build.psm1 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/build.psm1 b/build.psm1 index 55ac81bbe7..75f19dfe2b 100644 --- a/build.psm1 +++ b/build.psm1 @@ -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" }