-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInvoke-Tests.ps1
More file actions
26 lines (21 loc) · 861 Bytes
/
Copy pathInvoke-Tests.ps1
File metadata and controls
26 lines (21 loc) · 861 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#Requires -Version 5.1
<#
.SYNOPSIS
Runs the full Pester test suite for PowerShellDevToolkit.
.DESCRIPTION
Installs Pester 5+ if not present, then runs all tests under .\tests\
with detailed output. Exit code mirrors the Pester result (0 = pass).
.EXAMPLE
.\Invoke-Tests.ps1
#>
$ErrorActionPreference = 'Stop'
if (-not (Get-Module -ListAvailable -Name Pester | Where-Object { $_.Version -ge '5.0' })) {
Write-Host "Pester 5+ not found. Installing from PSGallery..." -ForegroundColor Yellow
Install-Module -Name Pester -MinimumVersion 5.0.0 -Force -Scope CurrentUser -SkipPublisherCheck
}
Import-Module Pester -MinimumVersion 5.0.0
$config = New-PesterConfiguration
$config.Run.Path = Join-Path $PSScriptRoot 'tests'
$config.Run.Exit = $true
$config.Output.Verbosity = 'Detailed'
Invoke-Pester -Configuration $config