From a3cd2b3453aabffb8714c44b16fbe4b7ecb92f98 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Fri, 1 Apr 2016 22:01:45 -0700 Subject: [PATCH] Add Start-PSPester function to replace pester.sh Super basic function that should be rewritten. --- PowerShellGitHubDev.psm1 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/PowerShellGitHubDev.psm1 b/PowerShellGitHubDev.psm1 index 84b8aaee1..74a281c06 100644 --- a/PowerShellGitHubDev.psm1 +++ b/PowerShellGitHubDev.psm1 @@ -207,6 +207,21 @@ function Get-PSOutput { } +function Start-PSPester { + [CmdletBinding()]param( + [string]$Flags = '-EnableExit -OutputFile pester-tests.xml -OutputFormat NUnitXml', + [string]$Tests = "*", + [ValidateScript({ Test-Path -PathType Container $_})] + [string]$Directory = "$PSScriptRoot/test/powershell" + ) + + & (Get-PSOutput) -c "Invoke-Pester $Flags $Directory/$Tests" + if ($LASTEXITCODE -ne 0) { + throw "$LASTEXITCODE Pester tests failed" + } +} + + function Start-PSxUnit { [CmdletBinding()]param() if ($IsWindows) {