Skip to content

Commit

Permalink
change to HaveParameter since that is v5
Browse files Browse the repository at this point in the history
  • Loading branch information
potatoqualitee committed Oct 20, 2024
1 parent 8d4f86f commit d615e36
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/appveyor.pester.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function Get-CodecovReport($Results, $ModuleBase) {

function Get-PesterTestVersion($testFilePath) {
$testFileContent = Get-Content -Path $testFilePath -Raw
if ($testFileContent -Like '*#pester5*')
if ($testFileContent -match 'HaveParameter')
{
return '5'
}
Expand Down Expand Up @@ -205,7 +205,7 @@ if (-not $Finalize) {
# we're in the "region" of pester 4, so skip
continue
}

#opt-in
if ($IncludeCoverage) {
$CoverFiles = Get-CoverageIndications -Path $f -ModuleBase $ModuleBase
Expand Down Expand Up @@ -234,7 +234,7 @@ if (-not $Finalize) {
}
}
}

#start the round for pester 5 tests
# Remove any previously loaded pester module
Remove-Module -Name pester -ErrorAction SilentlyContinue
Expand All @@ -244,7 +244,7 @@ if (-not $Finalize) {
$Counter = 0
foreach ($f in $AllTestsWithinScenario) {
$Counter += 1

#get if this test should run on pester 4 or pester 5
$pesterVersionToUse = Get-PesterTestVersion -testFilePath $f.FullName
if ($pesterVersionToUse -eq '4') {
Expand All @@ -262,7 +262,7 @@ if (-not $Finalize) {
$pester5Config.CodeCoverage.OutputFormat = 'JaCoCo'
$pester5Config.CodeCoverage.OutputPath = "$ModuleBase\Pester5Coverage$PSVersion$Counter.xml"
}

$trialNo = 1
while ($trialNo -le 3) {
if ($trialNo -eq 1) {
Expand All @@ -283,7 +283,7 @@ if (-not $Finalize) {
}
}
}

# Gather support package as an artifact
# New-DbatoolsSupportPackage -Path $ModuleBase - turns out to be too heavy
try {
Expand Down

0 comments on commit d615e36

Please sign in to comment.