Skip to content

Commit d615e36

Browse files
change to HaveParameter since that is v5
1 parent 8d4f86f commit d615e36

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/appveyor.pester.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ function Get-CodecovReport($Results, $ModuleBase) {
161161

162162
function Get-PesterTestVersion($testFilePath) {
163163
$testFileContent = Get-Content -Path $testFilePath -Raw
164-
if ($testFileContent -Like '*#pester5*')
164+
if ($testFileContent -match 'HaveParameter')
165165
{
166166
return '5'
167167
}
@@ -205,7 +205,7 @@ if (-not $Finalize) {
205205
# we're in the "region" of pester 4, so skip
206206
continue
207207
}
208-
208+
209209
#opt-in
210210
if ($IncludeCoverage) {
211211
$CoverFiles = Get-CoverageIndications -Path $f -ModuleBase $ModuleBase
@@ -234,7 +234,7 @@ if (-not $Finalize) {
234234
}
235235
}
236236
}
237-
237+
238238
#start the round for pester 5 tests
239239
# Remove any previously loaded pester module
240240
Remove-Module -Name pester -ErrorAction SilentlyContinue
@@ -244,7 +244,7 @@ if (-not $Finalize) {
244244
$Counter = 0
245245
foreach ($f in $AllTestsWithinScenario) {
246246
$Counter += 1
247-
247+
248248
#get if this test should run on pester 4 or pester 5
249249
$pesterVersionToUse = Get-PesterTestVersion -testFilePath $f.FullName
250250
if ($pesterVersionToUse -eq '4') {
@@ -262,7 +262,7 @@ if (-not $Finalize) {
262262
$pester5Config.CodeCoverage.OutputFormat = 'JaCoCo'
263263
$pester5Config.CodeCoverage.OutputPath = "$ModuleBase\Pester5Coverage$PSVersion$Counter.xml"
264264
}
265-
265+
266266
$trialNo = 1
267267
while ($trialNo -le 3) {
268268
if ($trialNo -eq 1) {
@@ -283,7 +283,7 @@ if (-not $Finalize) {
283283
}
284284
}
285285
}
286-
286+
287287
# Gather support package as an artifact
288288
# New-DbatoolsSupportPackage -Path $ModuleBase - turns out to be too heavy
289289
try {

0 commit comments

Comments
 (0)