Skip to content

Commit

Permalink
pester runner, detection based on standard Requires directive (#9528)
Browse files Browse the repository at this point in the history
  • Loading branch information
niphlod authored Oct 24, 2024
1 parent 3519a1a commit 7500fad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/Invoke-DbaQuery.Tests.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#HaveParameter - yeah, I know.
#Requires -Module @{ ModuleName="Pester"; ModuleVersion="5.0"}

BeforeAll {
$CommandName = (Get-Item $PSCommandPath).Name.Replace(".Tests.ps1", "")
Expand Down
2 changes: 1 addition & 1 deletion tests/appveyor.pester.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ function Get-CodecovReport($Results, $ModuleBase) {

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

0 comments on commit 7500fad

Please sign in to comment.