Skip to content

Commit 7500fad

Browse files
authored
pester runner, detection based on standard Requires directive (#9528)
1 parent 3519a1a commit 7500fad

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tests/Invoke-DbaQuery.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#HaveParameter - yeah, I know.
1+
#Requires -Module @{ ModuleName="Pester"; ModuleVersion="5.0"}
22

33
BeforeAll {
44
$CommandName = (Get-Item $PSCommandPath).Name.Replace(".Tests.ps1", "")

tests/appveyor.pester.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ function Get-CodecovReport($Results, $ModuleBase) {
162162

163163
function Get-PesterTestVersion($testFilePath) {
164164
$testFileContent = Get-Content -Path $testFilePath -Raw
165-
if ($testFileContent -match 'HaveParameter')
165+
if ($testFileContent -match '#Requires\s+-Module\s+@\{\s+ModuleName="Pester";\s+ModuleVersion="5\.')
166166
{
167167
return '5'
168168
}

0 commit comments

Comments
 (0)